derrick1123 Posted March 21, 2008 Share Posted March 21, 2008 $q = "UPDATE remember SET ('','$name','$email','$msg','$website','$time') VALUES (id, name, email, msg, website, time)"; Would this be able to work? Link to comment https://forums.phpfreaks.com/topic/97198-update-values/ Share on other sites More sharing options...
Daniel0 Posted March 21, 2008 Share Posted March 21, 2008 No, they're only in the format field=value. I.e. UPDATE remember SET name=$name, email=$email [...]; Link to comment https://forums.phpfreaks.com/topic/97198-update-values/#findComment-497356 Share on other sites More sharing options...
derrick1123 Posted March 21, 2008 Author Share Posted March 21, 2008 UPDATE remember SET msg='$msg', name='$name', email='$email', website='$website', time='$time' WHERE id='$id' ^So that should work? EDIT: I see remove the quotes...ok thanks ^.^ Link to comment https://forums.phpfreaks.com/topic/97198-update-values/#findComment-497357 Share on other sites More sharing options...
Daniel0 Posted March 21, 2008 Share Posted March 21, 2008 Well, actually the quotes should be there. I just forgot them in my previous post. Link to comment https://forums.phpfreaks.com/topic/97198-update-values/#findComment-497359 Share on other sites More sharing options...
Lamez Posted March 21, 2008 Share Posted March 21, 2008 <?php mysql_query("UPDATE `table` SET `value` = 'this', `anothervalue` = 'that' WHERE `id` = 'id'"); ?> Link to comment https://forums.phpfreaks.com/topic/97198-update-values/#findComment-497363 Share on other sites More sharing options...
derrick1123 Posted March 21, 2008 Author Share Posted March 21, 2008 Another question...I didn't think it was worth make a WHOLE new topic for. ---- I need it to only show 1 id at a time. How is this possible? Link to comment https://forums.phpfreaks.com/topic/97198-update-values/#findComment-497365 Share on other sites More sharing options...
Daniel0 Posted March 21, 2008 Share Posted March 21, 2008 Append LIMIT 1 to the query. Link to comment https://forums.phpfreaks.com/topic/97198-update-values/#findComment-497376 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.