for($count =1; $count<8; $count++) { $tmp = mysql_query("select * FROM testProc3"); if (is_null(mysql_result($tmp,$i,'otv'.$count))) ++$svet; }