Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in

someone can help me plizz… it’s make me crazy :(… i hope someone can solve my problem…
I have been trying to figure out what I am doing wrong. but i can’t…

here is my page…

<?php include_once("db.php"); session_start(); ?> <?php $uname = $_POST['n']; $pass = $_POST['p']; $sql = "SELECT count(*) FROM login WHERE( username='".$uname."' and password='".$pass."')"; # SELECT count(*) FROM login WHERE( # username='$uname' and password='$pass'); $qury = mysql_query($sql); $result = mysql_fetch_array($query); if($result[0]>0) { echo "Successful Login!"; $_SESSION['userName'] = $uname; echo "
Welcome ".$_SESSION['userName']."!"; echo "
SignUp"; echo "
SignIn"; echo "
LogOut"; } else { echo "Login Failed"; echo "
SignUp"; echo "
SignIn"; } ?>

and here is db.php…

<?php $conn = mysql_connect("localhost","root","password"); $db = mysql_select_db("resgister",$conn); ?>

i’m really appreciate it if someone can help me…

Hi there,

Take a look at a snippet of your code I copied:

Fix the word $qury to $query and you should be okay.

Hope this helps.

lol…
it’s work… thanks a lot man ;D

i hope u can help me another days…

Sponsor our Newsletter | Privacy Policy | Terms of Service