Jump to content

Need help reponding be if it delete a user


newprogram

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

 

Link to comment
Share on other sites

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";

}

}

Link to comment
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.