The if statement should return true, because $txn_id won't match the data stored. Is my syntax wrong?
$query = "SELECT * FROM txn WHERE txn_id = '$txn_id'"; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows[$result]==0) {
Your mysql_num_rows is wrong. Shouldn't have square brackets.
Try this out:
$query = "SELECT * FROM txn"; $query .= "WHERE txn_id = '$txn_id'"; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result)==0) {
Thank you!