Hello,
It seems my IF ($email_settings == "0") isnt working properly.
I am trying to get it so that IF a setting in a table field is set to 0 then it continues and executes the info between the {} which is to send an email. However, if the IF is set to 1 then it wont send the email.
Im not sure if its the IF I have wrong or the $email_settings that I have set wrong.
Ive tried a couple things such as having
if ($email_settings == "0")
if ($email_settings == 0)
if ($email_settings == '0')
but none of these seem to work!
If I use the IF ($email_settings == "0") then it doesnt send an email regardless of the setting.
However, if I use the IF ($email_settings == 0) then it sends it regardless of the setting.
Please help .... here is the segment of code
$emailsubject = "$send_to, you have a message at CyberPetWorld.com !!!.";
$members = fetch("SELECT * FROM members2 WHERE username = '$user' AND game = '$game'");
$members_profiles = fetch("SELECT * FROM members_profiles2 WHERE username = '$send_to' AND game = '$game'");
$getEmail = $members_profiles[email];
$emailaddress ="mail@cyberpetworld.com";
$email_settings = fetch("SELECT mail FROM mail_settings WHERE user_id = '$send_to' AND game = '$game'");
if ($email_settings == "0")
{
mail($getEmail,$emailsubject,$emailmessage,"From: $emailaddress \nContent-Type: text/html; charset=iso-8859-1\r\nMime-Version: 1.0\nContent-Transfer-Encoding: 7bit");
}