Hi guys,
I`m learning PHP with MySQL and have some problem.

I`m just creating a simple script to accept login details from index.php and transfer them to login.php via POST. 1st part went smooth. For 2nd part, login.php I`m having some problem.

I tried google and change the variable names too but the result was same. I kept getting error:
Code: 
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\login.php on line 10
My login.php is here:
PHP Code: 
<?php
$con
mysql_connect("localhost","usermaster","") or die (mysql_error());
$cName$_POST["boxuser"];
$cPass=$_POST["boxpass"];
mysql_select_db("mynewdb");
//$data = "select * from mytable where uname=".$cName."and upass=".$cPass;
$query "SELECT * FROM mytable";
$result mysql_query($query);
$row mysql_fetch_array($result);

if ((
strlen($row))>0)
{
    echo 
"Login successful.";
}
else
{
    echo 
"Login failed.";
}
mysql_close();
?>
Can anyone help me ?
nEw_boY Reviewed by nEw_boY on . Help With PHP Error Hi guys, I`m learning PHP with MySQL and have some problem. I`m just creating a simple script to accept login details from index.php and transfer them to login.php via POST. 1st part went smooth. For 2nd part, login.php I`m having some problem. I tried google and change the variable names too but the result was same. I kept getting error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\login.php on line 10 My login.php is here: <?php Rating: 5