I'm trying to select data from mySQL database using PHP and I encountered one problem. When I printed out the result after selecting data, it printed out "Resource ID #5" instead of the actual data. How can I fix this problem. Below is my code. It is really simple that I don't understand where the problem is. Please help.
$linkID = mysql_connect($host, $db_user, $db_pass);
mysql_select_db("$database", $linkID);
$result = mysql_query("SELECT password FROM logins WHERE username = '$user'", $linkID);
$pass = mysql_fetch_row($result);
if ($pass[0] === (Encrypt($password))) {
$cusid = mysql_query("SELECT cusid FROM logins WHERE username = '$user'", $linkID) or die(mysql_error()); //the problem is this line here
$SESSION['cusid'] = $cusid;
$SESSION['username'] = $user;
$_SESSION['logged'] = true;
}
else
echo "Either your username or password is incorrect. Please check and reenter them again.";
mysql_close($linkID);