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

$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);

lulemurfan,

You needed an echo statement to print the out as hielo mentioned.

Thank you for your help, I've now sorted it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.