Results 1 to 2 of 2

Thread: php not deleting from table?

  1. #1
    Join Date
    Feb 2010
    Location
    Falkirk, Scotland
    Posts
    142
    Thanks
    21
    Thanked 4 Times in 4 Posts

    Default php not deleting from table?

    i have installed a friends system on my site, and when a user sends a friend request, it will be accepted, and upon acceptance it should be deleted from mysql table 'friend_requests'. this doesnt happen though and just tells the user that they have another request from that same user who originally sent the request.

    any ideas?

    this is the accept case:
    PHP Code:
    case 'accept'//accept page
    if ($_GET[user]) { //get username

    $add mysql_query"INSERT INTO `friends` (`friendname` , `username`) VALUES ('$_GET[user]' , '$session->username') "); // add to your friends list
    $add2 mysql_query"INSERT INTO `friends` (`friendname` , `username`) VALUES ('$session->username' , '$_GET[user]') "); // fix friend bug
    $delete mysql_query"DELETE FROM `friend_requests` WHERE `by` = '$_GET[user]'"); // deletes friend request
    echo ( "$_GET[user] has been added as a friend! [<a href='userinfo.php?user=$reqs[by]' target='blank'>View Profile</a>] [<a href='newfriends.php'>More Requests?</a>] [<a href='index.php'>Home</a>]" ); // echos the completion
    }
    break; 
    //ends accept page 
    Last edited by liamallan; 04-12-2010 at 07:10 PM.

  2. #2
    Join Date
    Feb 2010
    Location
    Falkirk, Scotland
    Posts
    142
    Thanks
    21
    Thanked 4 Times in 4 Posts

    Default

    its ok guys, i got it sorted

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •