The loop starts after the first row of the html table obviously, so that where i'm copying the code from. Everything above this code is pure html.
<?
$i=1;
$query = "SELECT * FROM client $sql LIMIT $limitValue, $limit";
$result = mysql_query($query);
if ($result) {
$numRows = mysql_num_rows($result);
}
$bgcolor = "#F2F2F2";
if ($numRows > 0) {
while ($rows = mysql_fetch_array($result)) {
if ($bgcolor=="#F2F2F2") {
$bgcolor="#FFFFFF";
}
else {
$bgcolor="#F2F2F2";
}
$id = $rows['cID'];
$date = $rows['dateEntered'];
$firstName = $rows['FirstName'];
$lastName = $rows['LastName'];
$address = $rows['Address'];
$address2 = $rows['Address2'];
$city = $rows['City'];
$state = $rows['State'];
$zip = $rows['Zip'];
$phone = $rows['HomePhone'];
$email = $rows['Email'];
$busCellPhone = $rows['BusCellPhone'];
$interestedin = $rows['interestedin'];
$AddVIP = $rows['AddVIP'];
$comments = $rows['comments'];
$status = 1;
$SalesNotes = $rows['SalesNotes'];
$hide = $rows['hide'];
if ($SalesNotes != "") {
$status = 0;
}
if ($AddVIP != "" && $AddVIP == "1") {
$status = 0;
}
//if ($address2!="") {
//$address.="<br>".$address2;
//}
//$date = $dateEntered;
//$year = $date[0];
//$month=$date[1];
//$day = $date[2];
//$year = substr($year,2,2);
//echo($year);
//$date = $month.".".$day.".".$year;
?>
<tr onClick="expandcontent('row<? echo $i; ?>')">
<td style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?> border-left:#CCCCCC 2px solid; border-bottom:#CCCCCC 1px solid; cursor:pointer" class="body" bgcolor="<? echo $bgcolor; ?>">
<div align="center"><? echo $date; ?> </div></td>
<td class="body" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer" bgcolor="<? echo $bgcolor; ?>"><? echo $lastName; ?> </td>
<td class="body" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer" bgcolor="<? echo $bgcolor; ?>"><? echo $firstName; ?>
</td>
<td class="body" bgcolor="<? echo $bgcolor; ?>" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer"><? echo $city; ?></td>
<td class="body" bgcolor="<? echo $bgcolor; ?>" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer"><div align="center"><? echo $state; ?> </div></td>
<td class="body" bgcolor="<? echo $bgcolor; ?>" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer"><div align="center"><? echo $email; ?> </div></td>
<td nowrap bgcolor="<? echo $bgcolor; ?>" class="body" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer">
<div align="right"><? echo $phone; ?> </div></td>
<td nowrap bgcolor="<? echo $bgcolor; ?>" class="body" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer">
<div align="right"><? echo $interestedin; ?> </div></td>
<td class="body" bgcolor="<? echo $bgcolor; ?>" style="<? if ($i==1) { ?>border-top:#CCCCCC 2px solid;<? } ?>border-bottom:#CCCCCC 1px solid; cursor:pointer"><div align="center"><img src="images/status<? echo $status; ?>.gif" width="13" height="13"><? if ($hide == "True") { ?><img src="images/hide.png" width="15" height="10"><? }; ?><? if ($hide == "true") { ?><img src="images/hide.png" width="15" height="10"><? }; ?><? if ($hide == "False") { ?><img src="images/spacer.png" width="15" height="10"><? }; ?><? if ($hide == "") { ?><img src="images/spacer.png" width="15" height="10"><? }; ?></div></td>
</tr>
<tr bgcolor="#EBEBEB" class="switchcontent" id="row<? echo $i; ?>">
<td colspan="9" style="border-left:#CCCCCC 2px solid; border-bottom:#CCCCCC 1px solid">
<? // INFO // ?>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="7">
<tr>
<td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="FFFFFF" style="border-right:#999999 2px solid; border-bottom:#999999 2px solid">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="24" valign="top"><img src="images/corner.gif" width="14" height="14" align="top"><span class="title"><b> <? echo ("$firstName"); ?> <? echo ("$lastName"); ?></b></span></td>
<td align="right" valign="bottom" class="body">
<div align="right" id="buttonbar"> <a href="edit.php?id=<? echo $id; ?><? if ($hidden!="") { echo ("&hidden=1"); } if ($order != "" ) { echo ("&order=$order"); } if (($s==1) || ($s==2)) { echo ("&s=2$fields"); } ?>" target="blank"><img src="images/delete2.gif" align="middle" border="0"></a>
<? if ($hidden == "") { ?>
<a href="<? echo $PHP_SELF; ?>?h=1&id=<? echo $id; ?><? if ($order != "" ) { echo ("&order=$order"); } if (($s==1) || ($s==2)) { echo ("&s=2$fields"); } ?>"><img src="images/hide2.gif" align="middle" border="0"></a> |
<? } else { ?>
<a href="<? echo $PHP_SELF; ?>?h=2&id=<? echo $id; ?><? if ($hidden!="") { echo ("&hidden=1"); } if ($order != "" ) { echo ("&order=$order"); } if (($s==1) || ($s==2)) { echo ("&s=2$fields"); } ?>"><img src="images/unhide.gif" align="middle" border="0"></a> |
<? } ?>
<a href = "#" onClick="MM_openBrWindow('print.php?id=<? echo $id; ?>&p=1','','status=yes,scrollbars=yes,resizable=no,width=640,height=550')"><img src="images/print_icon.gif" width="25" height="20" border="0" align="middle"></a><img src="images/exit_icon.gif" width="19" height="20" border="0" style="cursor:hand,pointer" onClick="expandcontent('row<? echo $i; ?>')" align="middle">
</div></td>
<td width="12" valign="middle"> </td>
</tr>
<tr>
<td colspan="3"> <table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td style="border-top:#CCCCCC 1px solid"> <form action="<? echo $PHP_SELF ?>" method = "POST">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="body"><strong>Address:</strong></td>
<td class="body"><? echo ("$address"); ?></td>
<td class="body"><img src="../images/spacer.png" width="10" height="8"></td>
<td class="body"><strong>Community: </strong><? echo ("$interestedin"); ?></td>
</tr>
<tr>
<td> </td>
<td class="body"><? echo ("$city, $state $zip"); ?></td>
<td class="body"> </td>
<td class="body"> </td>
</tr>
<tr>
<td class="body"><strong>Phone:</strong></td>
<td class="body"><? echo ("$phone"); ?></td>
<td class="body"> </td>
<td class="body"> </td>
</tr>
<tr>
<td class="body"><strong>Work Phone:</strong></td>
<td class="body"><? echo ("$busCellPhone"); ?></td>
<td class="body"> </td>
<td class="body"><strong>VIP:</strong>
<input name="VIP" type="checkbox" value="1" <? if ($AddVIP == "1") echo "checked"; ?>></td>
</tr>
<tr>
<td class="body"><strong>Email:</strong></td>
<td class="body"><a href="mailto:<? echo ("$email"); ?>"><? echo ("$email"); ?></a></td>
<td valign="bottom" class="body"> </td>
<td valign="bottom" class="body"> </td>
</tr>
<tr>
<td colspan="2" class="body"><strong>Comments:</strong></td>
<td valign="bottom" class="body"> </td>
<td valign="bottom" class="body"><strong>Sales Notes :</strong></td>
</tr>
<tr>
<td colspan="2" valign="top" class="body"><textarea name="" cols="60" rows="" class="body" style="height:100px; padding:4px; border:#CCCCCC 1px solid"><? echo ("$comments"); ?></textarea></td>
<td valign="top" class="body"> </td>
<td valign="top" class="body">
<input type="hidden" name="id" value="<? echo $id; ?>">
.... more html
then...
</tr>
<? $i++; } } else { ?>
<tr>
<td colspan="9" class="body" align="center"><div style="padding:10px">There
were no entries found</div></td>
</tr>
<? } ?>