I am trying to set a switch based on a comparison of the result from mySQL table query. The query works if I am using a print or echo, but throws a syntax error when trying to use the exact same loop for a comparison. Code for comparison that throws the error is below.
//Define query for database entry lookup
$sql = "SELECT * FROM email_auth WHERE useremail='$user_email_address'";
//Define result for database entry lookup
$result = mysql_query($sql) or die(mysql_error());
//Find match for email authentication
$email_count = 0;
while($row = mysql_fetch_assoc($result)){
if ( $row['authID'] == $user_email_auth ) { $validemailrequest = "true" } //Line 60
$email_count++;
}
And the error I am getting…
<b>Parse error</b>: syntax error, unexpected '}' in
<b>/home/user/public_html/send_email.php</b> on line <b>60</b>
Yet works when using same for print…
//Define query for database entry lookup
$sql = "SELECT * FROM email_auth WHERE useremail='$user_email_address'";
//Define result for database entry lookup
$result = mysql_query($sql) or die(mysql_error());
//Find match for email authentication
$email_count = 0;
while($row = mysql_fetch_assoc($result)){
print $row['authID'];
$email_count++;
}
There seems to be a semi-colon missing after the conditional code.