Hello,
I am trying to use the code below to do the following;
In a MySQL table called submission, check to see if subcheck = 1 for the row where
submissionid = $submissionid
.If the answer to #1 above is yes, then take the
email
field from a MySQL table called "login" from the row where username = $submittor', and then email$comment
to that address.
It's not working. Any ideas why not?
Thanks in advance,
John
$querye = mysql_query("SELECT subcheck FROM submission WHERE subcheck = '1' AND WHERE submissionid = '$submissionid' ");
if (mysql_num_rows($querye) == 1)
{
$mailaddress = "SELECT email FROM login WHERE username = '$submittor'";
$queryem = mail($mailaddress, "Someone has commented on your submission $submission.", $comment, "[email protected]");
mysql_query($queryem) or die(mysql_error());
}
else
{
//your subcheck is not 1 / nothing was found
}