daveoffy Posted July 10, 2009 Share Posted July 10, 2009 I have the following code and I am just missing something stupid. I looked at it many times and than thought I would come here to get an answer. $insert = "INSERT INTO Sell(newstatus, buyer) VALUES('$newstatus', '$buyerusername') WHERE sell_id = '".$sellid."'"; $insertresult = mysql_query($insert); Link to comment https://forums.phpfreaks.com/topic/165479-solved-insert-not-working/ Share on other sites More sharing options...
rhodesa Posted July 10, 2009 Share Posted July 10, 2009 Step one whenever you have a problem, is to use mysql_error() to see what the error is: $insert = "INSERT INTO Sell(newstatus, buyer) VALUES('$newstatus', '$buyerusername') WHERE sell_id = '".$sellid."'"; $insertresult = mysql_query($insert) or die(mysql_error()); you will find that there is no WHERE clause for an INSERT statement. what are you trying to accomplish? Are you looking to UPDATE a record? Link to comment https://forums.phpfreaks.com/topic/165479-solved-insert-not-working/#findComment-872779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.