Jump to content

[SOLVED] Problem Updating Record


stevesimo

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.