View Full Version : Need help Delete certain values

08-31-2009, 12:19 AM
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());

08-31-2009, 12:51 AM
Try this instead:

$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.