只需
or die(mysqli_error($db));在查询末尾添加即可,这将显示mysqli错误。
mysqli_query($db,"INSERT INTO stockdetails (`itemdescription`,`itemnumber`,`sellerid`,`purchasedate`,`otherinfo`,`numberofitems`,`isitdelivered`,`price`) VALUES ('$itemdescription','$itemnumber','$sellerid','$purchasedate','$otherinfo','$numberofitems','$numberofitemsused','$isitdelivered','$price')") or die(mysqli_error($db));附带说明一下,我会说您有患上的风险
mysqlinjection,请在此处查看如何防止PHP中的SQL注入?。您应该真正使用准备好的语句来避免任何风险。


![如何显示我的MySQLi查询错误?[重复] 如何显示我的MySQLi查询错误?[重复]](http://www.mshxw.com/aiimages/31/374593.png)
