public function insert_data($array){
$db = new MySQLi(HOST,USER,PASS,DB);
$var = "adam";
$stmt = $db->stmt_init();
$query = "INSERT INTO `pages` (`name`,`text`,`image`,`meta_desc`,`meta_k开发者_如何学编程w`,`meta_author`,`image_thumb`) VALUES (? ? ? ? ? ? ?)";
$stmt->prepare($query);
$stmt->bind_param('sssssss',$var,$var,$var,$var,$var,$var,$var);
$stmt->execute();
}
my mysqli-> prepare returns false, and i dont understand why.
can any one see what i am doing wrong here?
thanks
VALUES (? ? ? ? ? ? ?)
should be VALUES (?, ?, ?, ?, ?, ?, ?)
Don't you need commas between ?
?
精彩评论