get rid of the if statement, I honestly dont even think it goes through considering count is determined by the sql and not as part of it, you can get a count without it, your sql will return 0 if you do a mysql_num_rows($SQL_LINK);
if you are tryiung t count the number of items grouped you can
$SQL_LINK=mysql_query("SELECT , count(field2) as total FROM table1 WHERE field1 = 'some_value' GROUP BY field2