1
1
<?php
2
- /* *
3
- * DB - A simple database class
4
- *
5
- * @author Author: Vivek Wicky Aswal. (https://twitter.com/#!/VivekWickyAswal)
6
- * @git htt://github.com/indieteq-vivek/simple-db-class
7
- * @version 0.2a
8
- *
9
- */
2
+ /* *
3
+ * DB - A simple database class
4
+ *
5
+ * @author Author: Vivek Wicky Aswal. (https://twitter.com/#!/VivekWickyAswal)
6
+ * @git htt://github.com/indieteq-vivek/simple-db-class
7
+ * @version 0.2a
8
+ *
9
+ */
10
10
require ("Log.class.php " );
11
11
class DB
12
12
{
@@ -28,7 +28,7 @@ class DB
28
28
# @array, The parameters of the SQL query
29
29
private $ parameters ;
30
30
31
- /**
31
+ /**
32
32
* Default Constructor
33
33
*
34
34
* 1. Instantiate Log class.
@@ -42,11 +42,11 @@ public function __construct()
42
42
$ this ->parameters = array ();
43
43
}
44
44
45
- /**
45
+ /**
46
46
* This method makes connection to the database.
47
47
*
48
- * 1. Reads the database settings from a ini file.
49
- * 2. Puts the ini content into the settings array.
48
+ * 1. Reads the database settings from a ini file.
49
+ * 2. Puts the ini content into the settings array.
50
50
* 3. Tries to connect to the database.
51
51
* 4. If connection failed, exception is displayed and a log file gets created.
52
52
*/
@@ -75,7 +75,7 @@ private function Connect()
75
75
die ();
76
76
}
77
77
}
78
- /**
78
+ /**
79
79
* Every method which needs to execute a SQL query uses this method.
80
80
*
81
81
* 1. If not connected, connect to the database.
@@ -119,7 +119,7 @@ private function Init($query,$parameters = "")
119
119
$ this ->parameters = array ();
120
120
}
121
121
122
- /**
122
+ /**
123
123
* @void
124
124
*
125
125
* Add the parameter to the parameter array
@@ -130,7 +130,7 @@ public function bind($para, $value)
130
130
{
131
131
$ this ->parameters [sizeof ($ this ->parameters )] = ": " . $ para . "\x7F" . $ value ;
132
132
}
133
- /**
133
+ /**
134
134
* @void
135
135
*
136
136
* Add more parameters to the parameter array
@@ -170,7 +170,7 @@ public function query($query,$params = null,$fetchmode = PDO::FETCH_ASSOC)
170
170
return NULL ;
171
171
}
172
172
}
173
- /**
173
+ /**
174
174
* Returns an array which represents a column from the result set
175
175
*
176
176
* @param string $query
@@ -191,7 +191,7 @@ public function column($query,$params = null)
191
191
return $ column ;
192
192
193
193
}
194
- /**
194
+ /**
195
195
* Returns an array which represents a row from the result set
196
196
*
197
197
* @param string $query
@@ -204,7 +204,7 @@ public function row($query,$params = null,$fetchmode = PDO::FETCH_ASSOC)
204
204
$ this ->Init ($ query ,$ params );
205
205
return $ this ->sQuery ->fetch ($ fetchmode );
206
206
}
207
- /**
207
+ /**
208
208
* Returns the value of one single field/column
209
209
*
210
210
* @param string $query
@@ -216,7 +216,7 @@ public function single($query,$params = null)
216
216
$ this ->Init ($ query ,$ params );
217
217
return $ this ->sQuery ->fetchColumn ();
218
218
}
219
- /**
219
+ /**
220
220
* Writes the log and returns the exception
221
221
*
222
222
* @param string $message
0 commit comments