dumpty Posted August 26, 2007 Share Posted August 26, 2007 Hey $query = "UPDATE table SET $this = $that WHERE id = $id"; $exe = mysql_query($query) or die ("Could not execute query"); Tried replacing the variables with definite numbers and values, still doesnt work. I can echo the variables right before so I know they exists etc. I am connected to the DB, right table name and all. What'd i do? Thankyou Link to comment https://forums.phpfreaks.com/topic/66755-solved-whats-wrong-with-my-update-code/ Share on other sites More sharing options...
nathanmaxsonadil Posted August 26, 2007 Share Posted August 26, 2007 change $query = "UPDATE table SET $this = $that WHERE id = $id"; to $query = "UPDATE table SET {$this} = '{$that}' WHERE id = '{$id}'"; Link to comment https://forums.phpfreaks.com/topic/66755-solved-whats-wrong-with-my-update-code/#findComment-334521 Share on other sites More sharing options...
dumpty Posted August 26, 2007 Author Share Posted August 26, 2007 Great thanks!!! Link to comment https://forums.phpfreaks.com/topic/66755-solved-whats-wrong-with-my-update-code/#findComment-334524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.