How do I delete a composite key?

From: Date: Sun, 26 Aug 2007 16:33:07 +0000
Subject: How do I delete a composite key?
Groups: php.general 
Request: Send a blank email to php-general+get-261297@lists.php.net to get a copy of this message
Im trying to delete a composite key but cannot figure out the proper format. Would somebody tell me where im messing up? I have an url that is supposed to send the member id and game id to a delete query. And the delete query is supposed to grab the id's based on type. This is the link: <a href=\"member_commit.php?action=remove&type=Member&id={$record->Member_id}&gametype=Game&id={$record->Game_id}\">[GAME REMOVAL]</a></td>\n"; This is the code that recieves the link information: case "remove":
     switch ($_GET['type']) {
       case "Member":
if (!isset($_GET['do']) || $_GET['do'] != 1) { ?> <p align="center" style="color:#FF0000"> Are you sure you want to delete this <?php echo $_GET['type']; ?>?<br> <a href="<?php echo $_SERVER['REQUEST_URI']; ?>&do=1">yes</a> or <a href="member_view.php">Index</a> </p> <?php } else { if ($_GET['type'] == "Member") {
     // delete reference to member
$sql = "DELETE
          FROM xsm_membergames
          WHERE Member_id = '" . mysql_real_escape_string((int)$_GET['id']) . " .
    AND Game_id = '" . mysql_real_escape_string((int)$_GET['id']) . "'";
} } _________________________________________________________________ Messenger Café — open for fun 24/7. Hot games, cool activities served daily. Visit now. http://cafemessenger.com?ocid=TXT_TAGHM_AugHMtagline

« previous php.general (#261297) next »