3raser Posted January 27, 2011 Share Posted January 27, 2011 mysql_query("UPDATE mods SET version='$version' AND name='$title' AND descritpion='$description' AND lastupdate='$date' WHERE id='$id'"); I don't think I'm doing it correctly. :/ Quote Link to comment https://forums.phpfreaks.com/topic/225803-multiple-sets-in-a-sql-query/ Share on other sites More sharing options...
jcbones Posted January 27, 2011 Share Posted January 27, 2011 mysql_query("UPDATE mods SET version='$version', name='$title', descritpion='$description', lastupdate='$date' WHERE id='$id'"); Quote Link to comment https://forums.phpfreaks.com/topic/225803-multiple-sets-in-a-sql-query/#findComment-1165755 Share on other sites More sharing options...
petroz Posted January 27, 2011 Share Posted January 27, 2011 Replace your AND's with ",". AND's are used for WHERE statements. Should look like so. UPDATE `table` SET `field1` = 'BLAH!', `field2` = 'FOO', `field3` = 'BAR' WHERE `id` = '1' AND `status` = '1'; Quote Link to comment https://forums.phpfreaks.com/topic/225803-multiple-sets-in-a-sql-query/#findComment-1165756 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.