Jump to content

[SOLVED] Trouble updating records..


vomitbomb

Recommended Posts

I'm able to update the records using this code, but it updates all the records in the database not just the one row that I want.

 

here is the code.

//create a query
$sql = "SELECT * FROM orders WHERE lname='$search'";
$result = mysql_query($sql, $conn);
$row = mysql_fetch_array( $result );

// Update record
$row = mysql_query("UPDATE orders SET status='2' WHERE status='1'") 
or die(mysql_error()); 

 

help appreciated

Link to comment
https://forums.phpfreaks.com/topic/105543-solved-trouble-updating-records/
Share on other sites

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.