添加管理员失败
添加失败 insert()如下
function insert($table,$array){
$keys=join(",",array_keys($array));
$vals="'".join("','",array_values($array))."'";
$sql="insert into {$table}($keys) values ({$vals})";
echo $sql;
mysqli_query(connect(),$sql);
echo mysqli_insert_id(connect());
}
输出 Notice: Undefined index: id
insert into imooc_admin(username,password,email) values ('','','')0 添加失败!
为啥mysqli_query(connect(),$sql)返回0,求教