
hi frnds
I have some error in following php codes at line no 9 please help me.
[color=blue][b]Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource[/b][/color]
[code]
<?php
require_once('clsConnect.php');
//Check User in Database
global $admin;
global $pwdadmin;
function fnUsrEnter($strSql)
{
$rs1 = mysql_query($strsql);
if(mysql_num_rows($rs1)>0)
{
while($row=mysql_fetch_array($rs1))
{
if($row['fldU_ID']=='$admin' and $row['fldPwd']=='$pwdadmin')
header("location:admlogin.php");
else
header("location:user.php");
}
}
}
global $user_tablename;
//making Connection.
if($_POST['cmdSubmit'] == 'Login')
{
$conn= new clsConnect();
$conn->fnConnect();
$sql1 ="SELECT fldU_ID, fldPwd FROM ".$user_tablename." WHERE fldU_ID='".$_POST['txtUser_Id']."' AND fldPwd='".$_POST['txtPwd']."'";
fnUsrEnter($sql1);
$conn->fnClose();
}
else
{
echo $_POST['cmdSubmit']."<br><br><table align='right' border='0' width='300' height='50' class='err'=''><br><br>
<tr><td bgcolor='#FFFFFF'>Invalid User--!<br>New User Please Sign Up---!<br></td></tr>
</table>";
}
?>
[/code]
and error is -
[color=red][b]Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\no links allowed\vblog1\userchk.php on line 9[/b][/color]