I am pulling dates from MySql using two tables. The first has the main record information. The second has the dates with the corrosponding recod Id from the first table.
The problem I’m am having is that when I pull the date records I am missing the first record.
here’s the MySql code:
[code=php]
$colname_campset = “1”;
if (isset($HTTP_GET_VARS[‘cnum’])) {
$colname_campset = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS[‘cnum’] : addslashes($HTTP_GET_VARS[‘cnum’]);
}
mysql_select_db($database_hodp, $hodp);
$query_campset = sprintf(“SELECT * FROM camps WHERE cnum = %s”, $colname_campset);
$campset = mysql_query($query_campset, $hodp) or die(mysql_error());
$row_campset = mysql_fetch_assoc($campset);
$totalRows_campset = mysql_num_rows($campset);
$query_cdwset1 = “SELECT * FROM campdw WHERE cnum = “.$row_campset[‘cnum’].” AND campday > 0 ORDER BY cnum DESC”;
$cdwset1 = mysql_query($query_cdwset1, $hodp) or die(mysql_error());
$row_cdwset1 = mysql_fetch_assoc($cdwset1);
and the while loop for the dates:
[code=php]
<?php
$counter=0;
while($i=mysql_fetch_object($cdwset1)){
$counter++;
$cdate = get_db_date($i->campday,’M d, Y’);
echo “t<input type=checkbox name=dckbox”.$counter.” onClick=count(this.form)> ”.$cdate;
if(fmod($counter,2)!=0){
//the row is odd
echo(“n</td></tr>nn<tr><td>n”);
}else{
//the row is even
echo(“n</td>n<td>”);
}
} ?>
thanks