aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-10-12 22:12:58 -0700
committerzotlabs <mike@macgirvin.com>2016-10-12 22:12:58 -0700
commit48026efddfdf063fad7c7bd7a86dd7fc4ca4a0a7 (patch)
tree49455a9983d37f6b9a908be77e6dea4a1b7db0d0 /include/items.php
parente31451000551c879bda7be8a5fbfe4b6457aa918 (diff)
downloadvolse-hubzilla-48026efddfdf063fad7c7bd7a86dd7fc4ca4a0a7.tar.gz
volse-hubzilla-48026efddfdf063fad7c7bd7a86dd7fc4ca4a0a7.tar.bz2
volse-hubzilla-48026efddfdf063fad7c7bd7a86dd7fc4ca4a0a7.zip
consolidate duplicated code for creating table entries from an array
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php15
1 files changed, 2 insertions, 13 deletions
diff --git a/include/items.php b/include/items.php
index b432748ee..a682fafaa 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1853,13 +1853,8 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
logger('item_store: ' . print_r($arr,true), LOGGER_DATA);
- dbesc_array($arr);
- $r = dbq("INSERT INTO " . TQUOT . 'item' . TQUOT . " (" . TQUOT
- . implode(TQUOT . ', ' . TQUOT, array_keys($arr))
- . TQUOT . ") VALUES ('"
- . implode("', '", array_values($arr))
- . "')" );
+ create_table_from_array('item',$arr);
// find the item we just created
@@ -3088,15 +3083,9 @@ function mail_store($arr) {
return 0;
}
- dbesc_array($arr);
-
logger('mail_store: ' . print_r($arr,true), LOGGER_DATA);
- $r = dbq("INSERT INTO mail (" . TQUOT
- . implode(TQUOT . ', ' . TQUOT, array_keys($arr))
- . TQUOT . ") VALUES ('"
- . implode("', '", array_values($arr))
- . "')" );
+ create_table_from_array('mail', $arr);
// find the item we just created