I currently have a page that returns 25 results in table format without a problem, but now I'm trying to place adsense code in the middle of that table. So, I'm using a counter to find the 13th result, and after it, I want to output the adsense code. As of now, I'm using a placeholder for the adsense code, but I can't seem to get it in it's own row. What I have is:

PHP Code:
     <?php
      $rowcolor 
1;
      
$result mysql_query($sql ,$db2);
      if (
$myrow mysql_fetch_array($result)) {
      
$counter 0;
       do {
         if (
$rowcolor == 1) {
         
$rowcolorhex "#ece8d7";
         
$rowcolor 0;
         } else {
         
$rowcolorhex "#ded7bc";
         
$rowcolor 1;
         }
         
printf("<tr>");
         
         
$counter $counter 1;
         
printf("<td width=300 bgcolor=%s align=center><a href=drink_recipes_%s class=\"linktable\" title=\"Drink recipe\">%s</a></td>"$rowcolorhex$myrow["drinkid"], $myrow["title"]);
         
printf("<td width=80 bgcolor=%s align=center><FONT face=verdana size=2>%s</font></td>"$rowcolorhex$myrow["date"]);
         
printf("<td width=75 bgcolor=%s><table bgcolor=%s border=0 cellspacing=0 cellpadding=0><tr>"$rowcolorhex$rowcolorhex);
       
$onstars round($myrow["rating"]);
         
$offstars $onstars;
         
//HELP HERE
          
if ($counter == 13){
         echo(
"Adsense goes here");
         }
         
//END HELP
         
for ($i 1$i <= $onstars$i++) {
         
printf("<td width=15 bgcolor=%s align=center valign=center><FONT face=arial size=2><img src=images/staron2.gif></font></td>"$rowcolorhex);
         }
         for (
$f 1$f <= $offstars$f++) {
         
printf("<td width=15 bgcolor=%s align=center valign=center><FONT face=arial size=2><img src=images/staroff2.gif></font></td>"$rowcolorhex);
         }
         
printf("</tr></table></td>");
         
         
printf("</tr>");
       } while (
$myrow mysql_fetch_array($result));
      }
      
printf("<tr>");
      if (!
$pagenum) {
       
$pagenum 0;
      }
      if (
$startrow 0) {
       
$lastnum $pagenum 1;
       
printf("<td align=left><a href=category.php?pagenum=$lastnum&searchingred=$searchingred&catid=$cat_req&letter=$letter_req2 class=\"linktable\">Previous Page</a></td>");
      } else {
       
printf("<td>&nbsp;</td>");
      }
      
printf("<td>&nbsp;</td>");
      if (
$lastpage == false) {
       
$nextnum $pagenum 1;
       print(
"<td align=left><a href=category.php?pagenum=$nextnum&searchingred=$searchingred&catid=$cat_req&letter=$letter_req2 class=\"linktable\">Next Page</a></td>");
      } else {
       
printf("<td>&nbsp;</td>");
      }
      
printf("</tr>");
      
?>
You can see the code in action here: http://drunkdrinks.com/drink_recipes_0_8

Keep in mind that I'm trying to place the adsense below the drink...I just can't seem to position the placeholder correctly. Your help is greatly appreciated!