-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnuts.php
More file actions
108 lines (32 loc) · 1.78 KB
/
nuts.php
File metadata and controls
108 lines (32 loc) · 1.78 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/* nuts and bolts - gondwe@akc-nov2016 */
function echo2($i){echo "<pre style='text-align:left'>";print_r($i);echo "</pre>";}
ob_start();session_start();
/* database name */
define("myd","speedbird");
/* resident folder */
define("root", "website/speed");
/* server */
define("server","localhost");
/* database password */
define("mypass","toor");
/* database user */
define("myuser","root");
/* SMS DECLARATIONS
==================================================== */
/* sms account username */
define("sms_username","ben10");
/* sms account api key */
define("sms_api_key","110f560a0775ad7786b60d25fa7ed696210e32482053911959d263baa9dc2d14");
/* set the sender id/ short code if it exists */
define("alphanumeric",NULL);
/*
akc Nov2016
leave this space blank
*/
function forge_db(){$db = new mysqli("localhost",myuser,mypass,myd);if ($db->connect_error) {die('Connect Error (' . $db->connect_errno . ') '. $db->connect_error);}return $db;}
$db = forge_db(); //just incase we need you from nowhere
function return_array($sql= FALSE){$db = forge_db(); $arr = NULL;if($sql == FALSE || $sql == NULL || $sql == ""){return NULL;}if($query = $db->query($sql)){if($query->num_rows > 0){while($row = $query->fetch_array()){$arr[] = $row; } }else{$arr = NULL; }}else{errgo("ERROR IN QUERY STATEMENT,".$sql.",".$db->error);}return $arr;}
function arraylist($sql= FALSE, $name=0){$arr = return_array($sql);if($name !== 0){echo2($arr);}if($arr !== NULL){ if(count($arr[0])>2){foreach($arr as $k=>$v){$arr2[$v[0]] = $v[1];} return $arr2;}else{return array_column($arr,$name);}}}
function single($sql ){return return_array($sql)[0][0];}
?>