I'm using PHP with MySQL. When a user enters a record, I want to check if a newly entered field is a match with a field in the MySQL database. So this is what I have (lets assume all the connections work):
$query = "SELECT * FROM tblTable WHERE sampleNum = 'sampleNum'";
$result = mysql_query($query);
// Trying to figure this part out...
if ($result) echo "<p>Match!</p>";
else echo "<p>No Match!</p>";
I tried echo-ing the $result field but it always returned:
Resource id #8
Whether or not the field is matching or not matching. Hope someone can help me with this problem.
Thanks,
-T
$query = "SELECT * FROM tblTable WHERE sampleNum = 'sampleNum'";
$result = mysql_query($query);
// Trying to figure this part out...
if ($result) echo "<p>Match!</p>";
else echo "<p>No Match!</p>";
I tried echo-ing the $result field but it always returned:
Resource id #8
Whether or not the field is matching or not matching. Hope someone can help me with this problem.
Thanks,
-T