newprogram Posted December 11, 2009 Share Posted December 11, 2009 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 https://forums.phpfreaks.com/topic/184817-need-help-reponding-be-if-it-delete-a-user/ Share on other sites More sharing options...
newprogram Posted December 11, 2009 Author Share Posted December 11, 2009 it tried this but it echo no matter what mysql_query("DELETE FROM usa WHERE email='$usercount'") or die(mysql_error()); echo "user Delete"; Link to comment https://forums.phpfreaks.com/topic/184817-need-help-reponding-be-if-it-delete-a-user/#findComment-975686 Share on other sites More sharing options...
newprogram Posted December 11, 2009 Author Share Posted December 11, 2009 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 https://forums.phpfreaks.com/topic/184817-need-help-reponding-be-if-it-delete-a-user/#findComment-975693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.