📜  插入数组 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:06.652000             🧑  作者: Mango

代码示例1
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);
}