Jump to content

Can't get records to delete!


twilitegxa

Recommended Posts

I'm having trouble getting my records deleted from my table. Here is part of the admin page (the delete code I'm trying to use starts around line 1050):

 

 



<td style="border:0px; text-align:center"><a href="?p=deletemember&user=<?=$id?>"><img src="images/icon_delete.png" style="border:0px" /></a></td>
   </tr>
<?   
}
}
?>
</table>
<?   
}
if($p=='deletemember'){
$sql = "DELETE FROM `carers` WHERE `id`='".$_GET['user']."'";
mysql_query($sql);
echo "<p class='fyi'>The selected carer has been deleted.</p>";
}


if($p=='editmember'){


   if($_POST['update2']){   
         $type   =   join(",", $_POST['type']);


         $sql="UPDATE `carers` SET `photo`='".$_POST['photo']."', `type`='".$type."', `availability`='".$_POST['availability']."', `experience`='".$_POST['experience']."', `qualifications`='".$_POST['qualifications']."', `description`='".$_POST['description']."', `active`='".$_POST['active']."' WHERE `uid`='".$_GET['user']."'";
         mysql_query($sql);


   $sql="UPDATE `users` SET `email`='".$_POST['email']."', `phone`='".$_POST['phone']."', `firstname`='".$_POST['firstname']."', `lastname`='".$_POST['lastname']."', `location`='".$_POST['location']."' WHERE `id`='".$_GET['user']."'";
         mysql_query($sql);
         echo "<p class='fyi'>Your information has been updated</p>";
   }
   if($_POST['update']){
      
         $sql="UPDATE `users` SET `email`='".$_POST['email']."', `phone`='".$_POST['phone']."', `firstname`='".$_POST['firstname']."', `lastname`='".$_POST['lastname']."', `location`='".$_POST['location']."' WHERE `id`='".$_GET['user']."'";
         mysql_query($sql);
         echo "<p class='fyi'>Your information has been updated</p>";
   }

 

 

Please, can anyone tell me what I'm doing wrong and how to fix it? What other information would you need to answer my question? I couldn't fit the entire admin page because it exceeded the limit on there, but please let me know if you need to see more to help me. I have left an example of how the edit code works to see if that helps.

Link to comment
https://forums.phpfreaks.com/topic/246727-cant-get-records-to-delete/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.