此php插入查詢在MYSQL xampp中不起作用。我找不到任何錯誤xampp的INSERT查詢MySQL不起作用
QUERY:
$query = "INSERT INTO member (id, username,fname,lname,email, password, salt)
VALUES ('$username', '$password', '$email', '$salt')";
此php插入查詢在MYSQL xampp中不起作用。我找不到任何錯誤xampp的INSERT查詢MySQL不起作用
QUERY:
$query = "INSERT INTO member (id, username,fname,lname,email, password, salt)
VALUES ('$username', '$password', '$email', '$salt')";
你缺少$ FNAME,LNAME $查詢也使用NULL的ID,如果自動遞增
$query = "INSERT INTO member (id, username,fname,lname,email, password, salt)
VALUES (NULL, '$username', '$fname', '$lname', '$password', '$email', '$salt')";
你逝去錯誤的列名稱數量。您的正確查詢應該如下所示:
$query = "INSERT INTO member (username,password,email,salt)
VALUES ('$username', '$password', '$email', '$salt')";
您並未將值插入查詢中指定的所有列。
在查詢
$query = "INSERT INTO member (id, username,fname,lname,email, password, salt)
VALUES ('$username', '$password', '$email', '$salt')";
要指定7列,只有4個值。所以無論是添加更多的值或刪除查詢中指定不必要的列像
$query = "INSERT INTO member (username, password,email, salt)
VALUES ('$username', '$password', '$email', '$salt')";
OR
$query = "INSERT INTO member (id, username,fname,lname,email, password, salt)
VALUES ('$id', '$username','$fname','$lname','$email', '$password', '$salt')";
感謝您的回覆 –
其工作正常 –
你檢查過Apache日誌嗎? – user2486495