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 (from parent 1:
aed2899
)
* db.php (db_update): don't assume has numeric keys.
author
Josh Grams
<josh@qualdan.com>
Sun, 23 Aug 2009 23:50:23 +0000
(19:50 -0400)
committer
Josh Grams
<josh@qualdan.com>
Sun, 23 Aug 2009 23:50:23 +0000
(19:50 -0400)
db.php
patch
|
blob
|
history
diff --git
a/db.php
b/db.php
index
f39d5e0
..
51452b8
100644
(file)
--- a/
db.php
+++ b/
db.php
@@
-286,10
+286,10
@@
function db_insert_ish($command, $table, $columns, $values) {
db_send_query($sql);
}
db_send_query($sql);
}
-# to be consistant with the syntax of the other db functions, $values can be an
+# to be consistent with the syntax of the other db functions, $values can be an
# array, a single value, or multiple parameters.
#
# array, a single value, or multiple parameters.
#
-# as usual the where clause stuff is optional, but it will ofcourse update the
+# as usual the where clause stuff is optional, but it will of course update the
# whole table if you leave it off.
#
# examples:
# whole table if you leave it off.
#
# examples:
@@
-316,6
+316,7
@@
function db_update($table, $columns, $values) {
$num_fields = count($columns);
if(is_array($values)) {
$num_fields = count($columns);
if(is_array($values)) {
+ $values = array_values($values);
$args = array_slice($args, 1);
} else {
$values = array_slice($args, 0, $num_fields);
$args = array_slice($args, 1);
} else {
$values = array_slice($args, 0, $num_fields);
@@
-339,7
+340,7
@@
function db_update($table, $columns, $values) {
$args = array_slice($args, 1);
$sql .= ' ';
$args = array_slice($args, 1);
$sql .= ' ';
- # any left for where claus arguments?
+ # any left for printf arguments?
if($args) {
$sql .= _db_printf($where, $args);
} else {
if($args) {
$sql .= _db_printf($where, $args);
} else {