mysql_fetch_array - Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.
http://php.net/manual/en/function.mysql-fetch-array.php

Use mysql_num_rows to check whether the query returned any results or not:
http://php.net/manual/en/function.mysql-num-rows.php

PHP Code: 
<?php

if (isset($_POST["boxuser"]) and isset($_POST["boxpass"])) { // use checks to prevent from direct page access

$conmysql_connect("localhost","usermaster","") or die (mysql_error());
$cNamemysql_real_escape_string($_POST["boxuser"]); // prevent mysql injections
$cPassmysql_real_escape_string($_POST["boxpass"]); // prevent mysql injections
mysql_select_db("mynewdb");
//$query = "select * from mytable where uname=".$cName."and upass=".$cPass;
$query "SELECT * FROM mytable WHERE uname=$cName and upass=$cPass";
$result mysql_query($query);
$row mysql_num_rows($result);

if (
$row 0)
{
    echo 
"Login successful.";
}
else
{
    echo 
"Login failed.";
}
mysql_close();

} else {

    die(
'RETRY AGAIN FROM THE LOGIN PAGE');

}

?>
Use php's mysql_real_escape_string to prevent from mysql injections attacks - http://www.php.net/manual/en/functio...ape-string.php