-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.php
More file actions
31 lines (30 loc) · 733 Bytes
/
user.php
File metadata and controls
31 lines (30 loc) · 733 Bytes
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
<?php
include_once 'Database.php';
class user {
private $name;
private $firstName;
private $lastName;
private $fullName;
function __construct($id) {
$db = new Database();
$result = $db->prepare("SELECT * FROM users WHERE user_id=:id;");
$result->bindValue(':id', $id, SQLITE3_INTEGER);
$row = $result->execute();
while ($r = $row->fetchArray()) {
$this->name = $r['username'];
$this->firstName = $r['FirstName'];
$this->lastName = $r['LastName'];
$this->fullName = $r['FirstName']." ".$r['LastName'];
}
}
function name() {
return $this->name;
}
function firstName() {
return $this->firstName;
}
function fullName() {
return $this->fullName;
}
}
?>