-4

我正在尝试将订单提交到数据库中,理论上它应该可以工作,但由于某种原因没有出现在数据库的表格中。

$result = "insert into orders(lastname, id, email, roomnumber, typeorder)
    values('".$lastname ."','".$ID ."','".$Email ."','".$RoomNumber ."','".$typeorder ."','" . "0');";
4

2 回答 2

4

您正在为 5 列插入 6 个值...删除“0”

请不要使用 mysql_* 而是尝试PDO

于 2013-01-02T17:02:44.507 回答
0

I would recommend you using data sanitization before running the query anyway. but here is the quick fix and it should work absolutely fine.
$result = "insert into orders(lastname, id, email, roomnumber, typeorder) values('".$lastname ."','".$ID ."','".$Email ."','".$RoomNumber ."','".$typeorder ."')";

于 2013-01-02T17:17:55.103 回答