Hi there- new to PHP and would really appreciate a little bit of help with something really quite trivial.
Basically I am searching an SQL DB with text brought in from an HTML form. I've checked and the correct string is being passed to the query. I am trying to return the value "cvalid" from the row which is returned based on the search for $lookup in "cname".
$lookup = $_POST['user'];
$sql = "SELECT cvalid FROM user WHERE cname = '$lookup'";
$result = mysql_query($sql) or die('mssg to be confirmed');
// test result display
echo $lookup;
echo $result;
It seems to return the correct $lookup, but "Resource id #5" as the $result. What am I doing wrong? Cheers 🙂