$sql = 'INSERT INTO `a1343640_test`.`Orders`
(`TicketId`, `Id`, `MenuItemName`, `Price`, `Quantity`, `Student ID`, `Student Year`, `Student Name`, `Student Email`)
VALUES ('$ticketID', '$orderID ', '$menu', '$price', '$quantity', '$studID', '$StudYr', '$StudName', '$StudEmail');';
我拥有的是什么,但是我的价值存在问题,我不确定我做错了什么。如果有人可以帮助我那会很棒。
答案 0 :(得分:0)
更新您的查询:
$sql = 'INSERT INTO `a1343640_test`.`Orders`
(`TicketId`, `Id`, `MenuItemName`, `Price`, `Quantity`, `Student ID`, `Student Year`, `Student Name`, `Student Email`)
VALUES ("'.$ticketID.'", "'.$orderID.'", "'.$menu.'", "'.$price.'", "'.$quantity.'", "'.$studID.'", "'.$StudYr.'", "'.$StudName.'", "'.$StudEmail.'");';
答案 1 :(得分:0)
你错误地使用引号,试试这个
$sql = 'INSERT INTO `a1343640_test`.`Orders`
(`TicketId`, `Id`, `MenuItemName`, `Price`, `Quantity`, `Student ID`, `Student Year`, `Student Name`, `Student Email`)
VALUES ("'.$ticketID.'", "'.$orderID.'", "'.$menu.'", "'.$price.'", "'.$quantity.'", "'.$studID.'", "'.$StudYr.'", "'.$StudName.'", "'.$StudEmail.'");';
或其他方式
$sql = "INSERT INTO a1343640_test.Orders (TicketId, Id, MenuItemName, Price, Quantity, Student ID, Student Year, Student Name, Student Email) VALUES ('$ticketID', '$orderID ', '$menu', '$price', '$quantity', '$studID', '$StudYr', '$StudName', '$StudEmail')";