When I run this script it always uses method 3, but I want it to only use that method if a number is less than 10. It just keeps adding up even after 10. Can anyone tell me whats wrong, I know it sound confusing. It cxalled when I enter a url like,

/enter2.php?contest=1&ban=271&user=114

Here is the part of the code that isnt working.

$date = date("Y-m-d");
$result = mysql_query("Select lastentry, con1, con2, con3, con4, con5 from entrylimit where id = '$user'");
$array = mysql_fetch_array($result);
// method 2
if (mysql_result($result,0,0)>0 and $array{'lastentry'} == $date and $array{'con$contest'} >= 10) {
$action = "max";
$method = "2";
}
// method 3
elseif (mysql_result($result,0,0)>0 and $array['lastentry'] == $date and $array['con$contest'] < 10) {
mysql_query("UPDATE count SET entries=entries+1 where id = '$contest'");
mysql_query("UPDATE banners SET clicks=clicks+1 where num = '$ban'");
mysql_query("UPDATE userinfo SET con$contest=con$contest+1, last_entry='$date' where id = '$user'");
mysql_query("UPDATE entrylimit SET con$contest=con$contest+1 where id = '$user'");
$action = "done";
$method = "3";
}
// method 4
elseif (mysql_result($result,0,0)>0 and $array['lastentry'] != $date) {
mysql_query("UPDATE count SET entries=entries+1 where id = '$contest'");
mysql_query("UPDATE banners SET clicks=clicks+1 where num = '$ban'");
mysql_query("UPDATE userinfo SET con$contest=con$contest+1, last_entry='$date' where id = '$user'");
mysql_query("UPDATE entrylimit SET con$contest='1', lastentry='$date' where id = '$user'");
$action = "done";
$method = "4";
}
// method 1
else { // add id if it doesnt exist.
$sql = "INSERT INTO entrylimit SET id = '$user', lastentry = '$date', con$contest = '1'";
if (!mysql_query($sql))
error("A database error occurred in processing your ".
"submission.\\nIf this error persists, please ".
"contact support@moneybyus.com.");
mysql_query("UPDATE count SET entries=entries+1 where id = '$contest'");
mysql_query("UPDATE banners SET clicks=clicks+1 where num = '$ban'");
mysql_query("UPDATE userinfo SET con$contest=con$contest+1, last_entry='$date' where id = '$user'");
$action = "done";
$method = "1";

}