-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.php
More file actions
37 lines (31 loc) · 809 Bytes
/
Copy pathdb.php
File metadata and controls
37 lines (31 loc) · 809 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
32
33
34
35
36
37
<?php
class db
{
public $conn;
function __construct($host="", $username="", $password="", $dbname='')
{
$this->conn = new mysqli($host, $username, $password, $dbname);
}
function Query($q)
{
return $this->conn->query($q);
}
function Result($result, $RowNumber, $FieldName)
{
if (strpos($FieldName,'.'))
{
$FieldName = explode('.', $FieldName);
$sCustomerFirstName = $FieldName[0];
$FieldName = $FieldName[1];
}
if($result->num_rows == 0) return('');
$result->data_seek($RowNumber);
$ceva = $result->fetch_assoc();
$r = $ceva[$FieldName];
return $r;
}
function rows($result)
{
return $r = $result->num_rows;
}
}