-11
$result=mysqli_query($connection,$query);
if(mysqli_affected_rows($connection)==1)
$result=mysqli_query($connection,$query);
if(mysqli_affected_rows($connection)==1)
您的$連接參數以字符串形式給出,而它應該是mysqli對象。從php docs:
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
/* Create table doesn't return a resultset */
if (mysqli_query($link, "CREATE TEMPORARY TABLE myCity LIKE City") === TRUE) {
printf("Table myCity successfully created.\n");
}
查看有多少相似項目在相關部分 –