I am struggling with what should be a simple query and despite internet searches etc I haven't been able to find something that works. Here is my code -
<?php require_once('../Connections/spotting.php');
include_once ("../auth.php");
include_once ("../authconfig.php");
include_once ("../check.php");
$username = $check["uname"];
$query = "SELECT * FROM spotting WHERE uname='$username'";
$result = mysql_query($query) or die ('unable to run R1: ' .mysql_error());
$count = mysql_num_rows($result);
$query2 = "SELECT spots FROM authuser WHERE uname='$username'";
$result2 = mysql_query($query2) or die ('unable to run R2: ' .mysql_error());
$spotval = $result2['spots'];
echo "you have $count Records </p>" ;
if($count==$result2)
{
header( 'Location: http://www.mysite.co.uk/upgrade.php' ) ;
}
else {
echo "You are below your limit $result2";
}
?>
can anyone point me in the direction please?