aman1649 Posted January 8, 2011 Share Posted January 8, 2011 Hey guys, I am still kinda new to php and I can't seem to get this to work. Basically I am calling a script and first I need it retrieve certain values which is working fine, but then after that is called I need it to clear those values it just displayed. To do that I am using UPDATE but it doesn't seem to be calling the UPDATE part. Any ideas? Here is the code: @mysql_select_db("$db_name") or die ("No DataBase Found"); $result = mysql_query("SELECT * FROM members WHERE id='$_POST[id]'"); while ($row = mysql_fetch_array($result)) { $message = $row['message']; $sender = $row['sender']; echo $message . "\n" . $sender; } mysql_query("UPDATE memebers SET message='' WHERE id='$_POST[id]'"); //These never get mysql_query("UPDATE memebers SET sender='' WHERE id='$_POST[id]'");//called or so it seems Link to comment https://forums.phpfreaks.com/topic/223819-update-not-being-called/ Share on other sites More sharing options...
Zurev Posted January 8, 2011 Share Posted January 8, 2011 Hey guys, I am still kinda new to php and I can't seem to get this to work. Basically I am calling a script and first I need it retrieve certain values which is working fine, but then after that is called I need it to clear those values it just displayed. To do that I am using UPDATE but it doesn't seem to be calling the UPDATE part. Any ideas? Here is the code: @mysql_select_db("$db_name") or die ("No DataBase Found"); $result = mysql_query("SELECT * FROM members WHERE id='$_POST[id]'"); while ($row = mysql_fetch_array($result)) { $message = $row['message']; $sender = $row['sender']; echo $message . "\n" . $sender; } mysql_query("UPDATE memebers SET message='' WHERE id='$_POST[id]'"); //These never get mysql_query("UPDATE memebers SET sender='' WHERE id='$_POST[id]'");//called or so it seems You mispelled members in your last two queries. Link to comment https://forums.phpfreaks.com/topic/223819-update-not-being-called/#findComment-1156841 Share on other sites More sharing options...
aman1649 Posted January 9, 2011 Author Share Posted January 9, 2011 Oh Wow that is really embarrassing, thanks a lot. hahaha Link to comment https://forums.phpfreaks.com/topic/223819-update-not-being-called/#findComment-1156901 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.