This should be a relatively easy procedure to code but for some reason I am just not able to get it working.
What Im trying to do
Members enter a competition, you are only allowed to enter once. To stop members from entering more than once I use the following code
//Check If user allready entered comp
$sql="SELECT member_nr, count(member_nr) as entered FROM competition WHERE member_nr ='$memNr' and competition = '$comp'";
$result = mysql_query( $sql ) or trigger_error( mysql_error() . " in " . $sql );
while($row = mysql_fetch_array($result)){
$isEntered = $row['entered'];
}//end while`
if($isEntered >1 ){
?>
<h1>You have allready entered</h1>
<?
}//end check if entered allready
My Problem
Im getting the error Notice: Undefined offset: 1
I cant for the live of me figure out why am getting this, Im guessing my sql query is incorrect...any advice will be appreciated