Jump to content

Recommended Posts

I'm using this to delete users from my database what I need is is to respond back if they found the user and deleted them , for instance when I use it it does delete the user but does not responds nothing back to let me know what happen but if the user doesn't exist it doesn't respond back nothing either. If it does find the user that exist I wanted to print "Delete" if the user does not exist I wanted to print "does not exist"

 

mysql_query("DELETE FROM usa WHERE email='$usercount'") 

or die(mysql_error());

 

 

thank you for your help

 

found it by messing around , i just see if it there and then delete

 

$result = mysql_query("SELECT * FROM usa WHERE email='$usercount'") or die(mysql_error()); 

$row = mysql_fetch_array( $result );

if ($usercount == $row['email']){

mysql_query("DELETE FROM usa WHERE email='$usercount'")  or die(mysql_error());

print "Delete";

exit;

}

else

{

print "No";

}

}

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.