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 !!!! ??? ??? ??? Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
techiefreak05 Posted August 30, 2006 Author Share Posted August 30, 2006 THANK YOU !!!! :-D THAT WORKED !! Quote Link to comment 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" Quote Link to comment 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.