How do I delete a composite key?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux