> $query=mysql_query("Select pass from members where uname='$username'");
> $result = mysql_query($query)
> or die("You are not authorized to be here.");

<?
$query=mysql_query("Select pass from members where uname='$username'");
$result = mysql_query($query);

// If the number of rows is less than one (meaning zero) then die()
if ($mysql_num_rows($result) < 1)) {
    die("You are not authorized to be here.");
}
?>

What you are doing is checking if the query is valid. Your die() would print
only if you had a faulty query (try changing pass to pass2), but if the
username is wrong, it returns an empty set.
The mysql_query() returns the "resource id #2" that you can use with the
mysql_fetch_array, mysql_num_rows etc to get printable information.

// Tobias



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to