``this code keeps kicking out the error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a2595218/public_html/login.php on line 49
with the out-put " The username you enterted was not found "
I should be seeing the error " You must active your acount to play. $form";" `
there for i thinks it must be skipping over the data base bit or something like that ?,
-------------------------------------------
<?php
error_reporting (E_ALL ^ E_NOTICE);
session_start();
?>
<HTML>
<HEAD>
<TITLE></TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19170">
<STYLE type=text/css>
BODY {
FONT-FAMILY: verdana, arial, sans-serif
}
</STYLE>
</HEAD>
<BODY>
<?php
$form = "<form action='./login.php' method='post'>
<table>
<TR>
<TD>Username:</TD>
<TD><input type ='text' name='username'></TD>
</TR>
<TR>
<TD>Password:</TD>
<TD><input type='password' name='password'></TD>
</TR>
<TR>
<TD></TD>
<TD><input type='submit' value='Login' name='loginbtn' ></TD>
</TR>
</table>
</form>";
if($_POST['loginbtn']){
$username = $_POST['username'];
$password =$_POST['password'];
if ($username){
if ($password){
require("connect.php");
$password = md5(md5("dF56cdc".$password."W6bs7cb"));
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$numrows = mysql_num_rows($query);
if ($numrows == 1){
$row = mysql_fetch_assoc($query);
$dbid =$row['id'];
$dbusername = $row['username'];
$dbpass = $row['password'];
$dbactive = $row['active'];
if($password = $dbpass) {
if ($dbactive ==1){
$_SESSION['userid'] =$dbid;
$_SESSION['username'] =$dbusername;
echo " You have been logged in as <b>$dbuser</b><a herf='./member.php'>click here</a>to go somewhere";
}
else
echo " You must active your acount to play. $form";
}
else
echo " You did not enter right password. $form";
}
else
echo "The username you enterted was not found . $form";
mysql_close();
}
Else
echo "You must enter password. $form";
}
Else
Echo " You must enter User Name. $form";
}
else
echo "$form";
?>
</BODY>
</HTML>
Any help ?
Thanks .