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? Quote 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 [...]; Quote 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 ^.^ Quote 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. Quote 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'"); ?> Quote 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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/97198-update-values/#findComment-497376 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.