-
Notifications
You must be signed in to change notification settings - Fork 0
/
mylibrary.php
53 lines (48 loc) · 925 Bytes
/
mylibrary.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
function doquery($query) {
$db_host = 'localhost';
$db_user = 'root';
$db_password = '';
$db_db = 'pool_db';
$db_port = 8080;
$mysqli = new mysqli(
$db_host,
$db_user,
$db_password,
$db_db
);
if ($mysqli->connect_error) {
echo 'Error11: '.$mysqli->connect_errno;
echo '<br>';
echo 'Error12: '.$mysqli->connect_error;
exit();
}
$result = $mysqli->query($query);
return $result;
}
function callSP($query) {
$db_host = 'localhost';
$db_user = 'root';
$db_password = '';
$db_db = 'pool_db';
$db_port = 8080;
$mysqli = new mysqli(
$db_host,
$db_user,
$db_password,
$db_db
);
if ($mysqli->connect_error) {
echo 'Error11: '.$mysqli->connect_errno;
echo '<br>';
echo 'Error12: '.$mysqli->connect_error;
exit();
}
$result = $mysqli->query($query);
return $result;
// $row = $result -> fetch_array(MYSQLI_ASSOC);
// // return $row["ss"];
// return $row;
// printf ("%s\n", $row["ss"]);
}
?>