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

 

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

}

}

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.