techiefreak05 Posted August 30, 2006 Share Posted August 30, 2006 this is getting frustrating.. i have this code to show what users have requested to be your friends. and to show their info and have a button to accept them..[code]<center><b>Users that are requesting to be your friend.</b><?php$query = mysql_query("SELECT * FROM friends WHERE `friend` = '$_SESSION[username]' AND `accepted` = ''");while ($array = mysql_fetch_array($query)){$friend=$array['username'];echo "<br><center><b>" .$friend. "</b></center>";echo "<a href='sendMessage.php?to=" .$friend. "'>-Message " .$friend. "-</a> |<a href='getInfo.php?user=" .$friend."'> -Get Info-</a> | <a href='http://zycoworld.com/" .$friend. "'>-View zPage-</a> | <form action=\"\" method=\"post\"> <table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td colspan=\"2\" align=\"right\"><input type=\"submit\" name=\"add\" value=\"-Accept-\"></td></tr></table></form>";}$query = mysql_query("SELECT * FROM friends WHERE `friend` = '$_SESSION[username]' AND `accepted` = ''");$array = mysql_fetch_array($query);$friend=$array['username'];if($_POST['add']){mysql_query("UPDATE friends SET accepeted = yes WHERE username = $_SESSION[username], friend = $friend");mysql_query("UPDATE friends SET accepeted = yes WHERE username = $friend, friend = $_SESSION[username]");}?>[/code]the first half works! it shows the users requesting to be your friend.. BUT when i click the button to accept.. it doesnt update the table with "yes" in the accepted column... whats wrong. im going crazy here !!!! ??? ??? ??? Link to comment https://forums.phpfreaks.com/topic/19102-solved-mysql-update-issue-please-help/ Share on other sites More sharing options...
.josh Posted August 30, 2006 Share Posted August 30, 2006 [code]<?phpmysql_query("UPDATE friends SET accepeted = 'yes' WHERE username = '$friend' AND friend = '{$_SESSION['username']}'");?>[/code]also, are you sure the field "accepeted" is correctly spelled? Link to comment https://forums.phpfreaks.com/topic/19102-solved-mysql-update-issue-please-help/#findComment-82639 Share on other sites More sharing options...
techiefreak05 Posted August 30, 2006 Author Share Posted August 30, 2006 THANK YOU !!!! :-D THAT WORKED !! Link to comment https://forums.phpfreaks.com/topic/19102-solved-mysql-update-issue-please-help/#findComment-82640 Share on other sites More sharing options...
techiefreak05 Posted August 30, 2006 Author Share Posted August 30, 2006 and .. no accepted was not spelled rite.. i just noticed that a second ago, and changed the code to "accepted" Link to comment https://forums.phpfreaks.com/topic/19102-solved-mysql-update-issue-please-help/#findComment-82642 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.