I have a problem with the condition if
. (Mysql_query) I check in my database, and if it USER
does not exist, this is an else condition. And that is not what I want. I want it to execute the function error_type(...);
→ - this is the manual function that I create. What is:
else{
var_dump($response);
mysql_query("DELETE FROM info_compte WHERE username ='$user'");
echo "<pre>";
echo "L'utilisateur <b>".$user."</b> a été supprimé avec succès!";
echo "</pre>";
}
Here is my complete function: (for error_type
I require at the beginning of the file)
function db_delete($user, $site){
$querycon = "SELECT username FROM info_compte WHERE username = '$user' AND siteWeb = '$site'";
$response = mysql_query($querycon);
if($response > 0)
error_type(6, $user,"");
else {
var_dump($response);
mysql_query("DELETE FROM info_compte WHERE username ='$user'");
echo "<pre>";
echo "L'utilisateur <b>".$user."</b> a été supprimé avec succès!";
echo "</pre>";
}
}//db_delete
Thank you all for your suggestion.
source
share