Answers for "insert array"

PHP
0

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);
}
Posted by: Guest on October-11-2021

Browse Popular Code Answers by Language