0

This is the part which searches and add the result to the 'pass' variable. At one stage I was getting a resource id number and found to get around that, but when I do this I get nothing on the pass variable

$result = mysql_query("SELECT `Pass` FROM `wiki` WHERE `User` ='" . $user ."'");
      if ($result) {
      $row = mysql_fetch_assoc($result);
      $pass = $row['Pass'];
      mysql_free_result($result);
      }
      mysql_close($con);

Can anyone help me please?
Thanks

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by lulemurfan
0

$result = mysql_query("SELECT `Pass` FROM `wiki` WHERE `User` ='" . $user ."'");
if (!$result) {
die( mysql_error() );
}
elseif( !mysql_num_rows($result) ){
echo "No records matched your search criteria";
}
else{
$row = mysql_fetch_assoc($result);
$pass = $row;
echo "found: " . $row;
}
mysql_free_result($result);
mysql_close($con);

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.