vwinstead Posted February 5, 2009 Share Posted February 5, 2009 I know this doesn't work because I tried it, but what is the correct format for changing the value of a field for a specific line according to an "id" number: $query = "INSERT INTO contents (body) VALUES ('$postedValue') WHERE id=0"; So far I've only been able to INSERT a whole new line, but I don't want to do that, I want to change the value of the "body" field in the line corresponding to an "id" value of zero. Link to comment https://forums.phpfreaks.com/topic/143938-solved-alter-a-specific-field/ Share on other sites More sharing options...
flyhoney Posted February 5, 2009 Share Posted February 5, 2009 UPDATE contents SET body = '$postedValue' WHERE id = 0 Link to comment https://forums.phpfreaks.com/topic/143938-solved-alter-a-specific-field/#findComment-755296 Share on other sites More sharing options...
Snart Posted February 5, 2009 Share Posted February 5, 2009 "UPDATE body SET contents = '$postedValue' WHERE id=0" Link to comment https://forums.phpfreaks.com/topic/143938-solved-alter-a-specific-field/#findComment-755298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.