stevesimo Posted March 30, 2007 Share Posted March 30, 2007 Hi, I am trying to update a record in my database. Although the code is running, the database record is not being updated. Here is my code: $result = mysql_query("UPDATE orders SET Address1 = '$address1', Address2 = '$address2', Address3 = '$address3', County = $county, Postcode = $postcode WHERE PolicyID = '$policyid'"); PolicyID isnt a primary keyfield, will this make a difference or should the update still be executed? Can anyone see what I am doing wrong? Thanks, Steve (Blackpool) ??? Link to comment https://forums.phpfreaks.com/topic/44941-solved-problem-updating-record/ Share on other sites More sharing options...
spfoonnewb Posted March 30, 2007 Share Posted March 30, 2007 I see a few syntax issues, $result = mysql_query("UPDATE orders SET Address1 = '$address1', Address2 = '$address2', Address3 = '$address3', County = '$county', Postcode = '$postcode' WHERE PolicyID = '$policyid'") or die(mysql_error()); Try that, and if it doesn't work it will produce an error that you can share, or fix. Link to comment https://forums.phpfreaks.com/topic/44941-solved-problem-updating-record/#findComment-218278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.