<?php //This is part of the DVDLender Add-On, we will keep the list very seperate SQL queries $lendlist = daSQL('SHOW TABLES FROM dvdlisting');while ($tmp = mysql_fetch_assoc($lendlist)) { $lendest[] = $tmp;} //do { $lend_whore = daSQL("SELECT COUNT(*) as lendCOUNT FROM `$lender[0]` WHERE comments LIKE '%Lent%' GROUP BY comments"); } while ($lender[] = mysql_fetch_row($lendlist));foreach ($lendest as $value) { $lend_whore = daSQL("SELECT COUNT(*) as lendCOUNT FROM `$value['Tables_in_dvdlisting']` WHERE comments LIKE '%Lent%'");} $whore_lend = mysql_fetch_assoc($lend_whore); if($whore_lend['lendCOUNT'] == 1) { ?> <td>To Start Click on a Letter...To Add a listing Click 'Add', If you need help, talk to Dave </td> <td bgcolor="#FFF0F0">You have <?php echo $whore_lend['lendCOUNT'];?> dvd on loan, Click <a href="index.php?mode=lender">here</a> to view it!</td> <?php} elseif($whore_lend['lendCOUNT'] >= 2) { ?> <td>To Start Click on a Letter...To Add a listing Click 'Add', If you need help, talk to Dave </td> <td bgcolor="#FFF0F0">You have <?php echo $whore_lend['lendCOUNT'];?> dvd's on loan, Click <a href="index.php?mode=lender">here</a> to view them!</td><?php} else { ?> <td>To Start Click on a Letter...To Add a listing Click 'Add', If you need help, talk to Dave </td> <?php } ?> <pre> <?php print_r($lendest); ?> </pre>