Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.