好的,我有这个代码:
<?//admin
$host = 'localhost'; // Host name Normally 'LocalHost'
$user = 'root'; // MySQL login username
$pass = ''; // MySQL login password
$database = 'juliver'; // Database name
$table = 'admin'; // Members name
mysql_connect($host, $user, $pass);
mysql_select_db($database);
if (isset($_POST['acc']) && ($_POST['pass']))
{
$username = mysql_real_escape_string($_POST['acc']);
$password = hash('sha512', $_POST['pass']);
$result = mysql_query("SELECT * FROM admin WHERE username = '$username' AND password = '$password'");
if(mysql_num_rows($result))
{
// Login
echo "has been login";
}
else
{
// Invalid username/password
echo 'Error: Invalid username or password';
}
exit;
}
else
{
echo "not been set";
}
?>
我收到了这个错误:“警告:mysql_num_rows() 期望参数 1 是资源,第 17 行的 C:\xampp\htdocs\mu2\admin.php 中给出的布尔值已登录”,这里有人可以帮助我吗请弄清楚那个错误到底是什么?..提前谢谢
无论如何,我对任何建议都持开放态度。