keyboard
08-12-2011, 08:46 PM
Hello everyone,
Somewhere on this page it is giving this error
( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Documents and Settings\Owner\Desktop\canberra amatuer productions\www\Canberra Amatuer Productions\messaging2\Login2.php on line 18
Call Stack
# Time Memory Function Location
1 0.0004 375824 {main}( ) ..\Login2.php:0
2 0.0052 383328 mysql_num_rows ( ) ..\Login2.php:18
( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Documents and Settings\Owner\Desktop\canberra amatuer productions\www\Canberra Amatuer Productions\messaging2\Login2.php on line 25
Call Stack
# Time Memory Function Location
1 0.0004 375824 {main}( ) ..\Login2.php:0
2 0.0055 383496 mysql_num_rows ( ) ..\Login2.php:25
<?php
session_start();
require_once 'database.php';
$username = $_POST['user'];
$escaped_username = mysql_real_escape_string($username);
$md5_password = md5($_POST['pass']);
$queryN = mysql_query("select * from user where username = '".$username."' and password = '".$md5_password."' AND
level='1'");#This variable will check if the user is a level 1 user (Normal User)
$queryA = mysql_query("select * from user where username = '".$username."' and password = '".$md5_password."' AND
level='9'");#This variable will check if the user is a level 9 user (Admin User)
if(mysql_num_rows($queryN) == 1)
{
$resultN = mysql_fetch_assoc($queryN);
$_SESSION['user'] = $_POST['user'];
header("location:Index.php");
}
elseif(mysql_num_rows($queryA) == 1)
{
$resultA = mysql_fetch_assoc($queryA);
$_SESSION['admin'] = $_POST['user'];
header("location:index.php");
}
else{
echo "Wrong Username or Password";
}
?>
<form name="back" method="post" action="login.php">
<input type="submit" name="back" id="back" value="Back to Home">
Any help?
Somewhere on this page it is giving this error
( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Documents and Settings\Owner\Desktop\canberra amatuer productions\www\Canberra Amatuer Productions\messaging2\Login2.php on line 18
Call Stack
# Time Memory Function Location
1 0.0004 375824 {main}( ) ..\Login2.php:0
2 0.0052 383328 mysql_num_rows ( ) ..\Login2.php:18
( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Documents and Settings\Owner\Desktop\canberra amatuer productions\www\Canberra Amatuer Productions\messaging2\Login2.php on line 25
Call Stack
# Time Memory Function Location
1 0.0004 375824 {main}( ) ..\Login2.php:0
2 0.0055 383496 mysql_num_rows ( ) ..\Login2.php:25
<?php
session_start();
require_once 'database.php';
$username = $_POST['user'];
$escaped_username = mysql_real_escape_string($username);
$md5_password = md5($_POST['pass']);
$queryN = mysql_query("select * from user where username = '".$username."' and password = '".$md5_password."' AND
level='1'");#This variable will check if the user is a level 1 user (Normal User)
$queryA = mysql_query("select * from user where username = '".$username."' and password = '".$md5_password."' AND
level='9'");#This variable will check if the user is a level 9 user (Admin User)
if(mysql_num_rows($queryN) == 1)
{
$resultN = mysql_fetch_assoc($queryN);
$_SESSION['user'] = $_POST['user'];
header("location:Index.php");
}
elseif(mysql_num_rows($queryA) == 1)
{
$resultA = mysql_fetch_assoc($queryA);
$_SESSION['admin'] = $_POST['user'];
header("location:index.php");
}
else{
echo "Wrong Username or Password";
}
?>
<form name="back" method="post" action="login.php">
<input type="submit" name="back" id="back" value="Back to Home">
Any help?