Error reporting level is set to so that it shows also notices(propably set to E_ALL). Of course it would be great to correct those at the code level. You should always define your variables. In this case, give the $counter variable a value before raising its value with $counter++
$counter = 0; // this defines $counter's base value
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if($counter++ % 2 == 0){
...
If you have too much of those maybe it should be wise to lower the error reporing level. You can do that in php.ini or in the www-servers configfile(for example if its apache, httpd.conf).
Anyway if you dont want those notices you can set error_reporting to for example E_ALL & ~E_NOTICE which gives normal errors without notices.