Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

insert array

protected function build_sql_insert($table, $data) {
    $key = array_keys($data);
    $val = array_values($data);
    $sql = "INSERT INTO $table (" . implode(', ', $key) . ") "
         . "VALUES ('" . implode("', '", $val) . "')";
    return($sql);
}
Source by www.phpflow.com #
 
PREVIOUS NEXT
Tagged: #insert #array
ADD COMMENT
Topic
Name
5+5 =