Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea7f476
)
* db.php (db_get_row, db_get_rows): optional arg for result type.
author
Josh Grams
<josh@qualdan.com>
Tue, 4 Aug 2009 21:34:38 +0000
(17:34 -0400)
committer
Josh Grams
<josh@qualdan.com>
Tue, 4 Aug 2009 21:34:38 +0000
(17:34 -0400)
db.php
patch
|
blob
|
history
diff --git
a/db.php
b/db.php
index
4a58db8
..
cd68d8d
100644
(file)
--- a/
db.php
+++ b/
db.php
@@
-151,13
+151,13
@@
function db_send_get($table, $columns, $where, $args) {
}
}
-function db_get_rows($table, $columns, $where = '') {
+function db_get_rows($table, $columns, $where = '', $type = MYSQL_NUM) {
$args = func_get_args();
$args = array_slice($args, 3);
$result = db_send_get($table, $columns, $where, $args);
$rows = array();
$args = func_get_args();
$args = array_slice($args, 3);
$result = db_send_get($table, $columns, $where, $args);
$rows = array();
- while($row = mysql_fetch_row($result)) {
+ while($row = mysql_fetch_array($result, $type)) {
$rows[] = $row;
}
$rows[] = $row;
}
@@
-181,12
+181,12
@@
function db_get_column($table, $columns, $where = '') {
return $column;
}
return $column;
}
-function db_get_row($table, $columns, $where = '') {
+function db_get_row($table, $columns, $where = '', $type = MYSQL_NUM) {
$args = func_get_args();
$args = array_slice($args, 3);
$result = db_send_get($table, $columns, $where, $args);
$args = func_get_args();
$args = array_slice($args, 3);
$result = db_send_get($table, $columns, $where, $args);
- $row = mysql_fetch_row($result);
+ $row = mysql_fetch_array($result, $type);
mysql_free_result($result);
mysql_free_result($result);