插入管理员记录提示错误,求解答,感激不尽
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
2015-02-28
'insertbuy_admin(username,password,email)values('','','')' at line 1
我插入的语法是这样的
function insert($table,$array){
$keys=join(",",array_keys($array));
$vals="'".join("','",array_values($array))."'";
$sql="insert{$table}($keys)values({$vals})";
mysql_query($sql)
or die(mysql_error());
return mysql_insert_id();
}
举报