-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.php
35 lines (27 loc) · 1 KB
/
User.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
class User
{
//Database connection link
private $con;
//Class constructor
function __construct()
{
//Getting the DbConnect.php file
require_once dirname(__FILE__) . '/DbConnect.php';
//Creating a DbConnect object to connect to the database
$db = new DbConnect();
//Initializing our connection link of this class
//by calling the method connect of DbConnect class
$this->con = $db->connect();
}
//storing sms in database
public function createUser($userid,$usertimestamp,$userphonenumber,$userfid, $usergid, $useripaddr){
$stmt = $this->con->prepare("INSERT INTO user (id,timestamp,phonenumber,fid,gid,ipaddr) VALUES (?,?,?,?,?,?)");
$stmt->bind_param("ssssss",$userid,$usertimestamp,$userphonenumber,$userfid, $usergid, $useripaddr);
if($stmt->execute())
return 0; //return 0 means success
return 1; //return 1 means failure
}
// $con->close();
}
?>