Results 1 to 2 of 2

Thread: Need help Delete certain values

  1. #1
    Join Date
    Aug 2009
    Location
    Florida
    Posts
    23
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Need help Delete certain values

    I'm trying to figure out how to delete a username from a certain event and not all events. Below is what I have tried but, it doesn't work. any suggestions?

    This is the error message I get.

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set event_id = "2", uname = "justin"' at line 1


    $q4 = "delete from event_attendies set event_id = \"$_POST[event_id]\", uname = \"$_SESSION[uname]\"";
    $r4 = mysql_query($q4) or die(mysql_error());

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Try this instead:

    Code:
    $q4 = "DELETE FROM `event_attendies` WHERE `event_id` = '".$_POST['event_id']."' AND `uname` = '".$_SESSION[uname]."'";
    $r4 = mysql_query($q4) or die(mysql_error());
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. The Following User Says Thank You to thetestingsite For This Useful Post:

    captainjustin (08-31-2009)

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
  •