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:
e2adfcf
)
added db_insert
author
Jason Woofenden
<jason183@herkamire.com>
Tue, 26 Dec 2006 21:12:16 +0000
(16:12 -0500)
committer
Jason Woofenden
<jason183@herkamire.com>
Tue, 26 Dec 2006 21:12:16 +0000
(16:12 -0500)
db.php
patch
|
blob
|
history
diff --git
a/db.php
b/db.php
index
89e972e
..
b8febdb
100644
(file)
--- a/
db.php
+++ b/
db.php
@@
-207,4
+207,21
@@
function db_get_value($table, $columns, $where = '') {
return $value;
}
+function db_insert($table, $columns, $values) {
+ $sql = "INSERT INTO $table ($columns) values(";
+
+ $first = true;
+ foreach($values as $value) {
+ if($first) {
+ $first = false;
+ } else {
+ $sql .= ',';
+ }
+ $sql .= '"' . enc_sql($value) . '"';
+ }
+ $sql .= ')';
+
+ db_send_query($sql);
+}
+
?>