Foser Posted July 6, 2007 Share Posted July 6, 2007 if (isset($_POST['submit'])) { if (isset($_POST['username_check'])){ mysql_query("UPDATE user_info SET username = {$_POST[username]} WHERE username = {$username}"); }} for some reason it does not update. the statement gets passed but it never updates. I have put in an echo in each if statement to test if they get passed and they do. they just dont update. Link to comment https://forums.phpfreaks.com/topic/58697-mysql_query-update-not-updating/ Share on other sites More sharing options...
Harley1979 Posted July 6, 2007 Share Posted July 6, 2007 Try: if (isset($_POST['submit'])) { if (isset($_POST['username_check'])){ mysql_query("UPDATE user_info SET username = '$_POST[username]' WHERE username = '$username'"); }} Link to comment https://forums.phpfreaks.com/topic/58697-mysql_query-update-not-updating/#findComment-291129 Share on other sites More sharing options...
MemphiS Posted July 6, 2007 Share Posted July 6, 2007 if (isset($_POST['submit'])) { if (isset($_POST['username_check'])){ mysql_query("UPDATE user_info SET username = '".$_POST['username']."' WHERE username = '$username'"); } } Should work.. Link to comment https://forums.phpfreaks.com/topic/58697-mysql_query-update-not-updating/#findComment-291142 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.