And I am not sure why!
Below is the code which I use to display a list of entries which take place either >= today.. But it always leaves off the first entry of the list. I double checked this by creating a duplicate of the script leaving off the part to narrow it down to >= today, which gives me the complete list.
code:
$connect= mysql_connect("localhost","root")
or die("Could not connect to database in localhost !");
$result=mysql_select_db("testdiw")
or die("Could not select that database !");
//$today = date("F j, Y");
$sqlquery = "SELECT id, diwtitle, date_string FROM diw_alpha ORDER BY date_string";
$queryresult = mysql_query($sqlquery) or die(" Could not execute mysql query !");
$row = mysql_fetch_row($queryresult);
$date_string = $row[0];
$diwtitle = $row[1];
$id = $row[2];
$tdcount = 1;
$numtd = 1; // number of cells per row
echo '
<TABLE border="0">
<TR>
<TD> Date of Event </TD>
<TD> Title</TD>
<TD> Dep ID </TD>';
while($row = mysql_fetch_array($queryresult)) {
if ($tdcount == 1) echo "<tr>";
echo '<td>'.$row['date_string'].'</td><td><a href="damndiw4.php?id='.$row['id'].'"> '.$row['diwtitle'],'</a></td><td>'.$row['id'].'</td>';
if ($tdcount == $numtd) {
echo "</tr>";
$tdcount = 1;
} else {
$tdcount++;
}
}
// time to close up our table
if ($tdcount!= 1) {
while ($tdcount <= $numtd) {
echo "<td> </td>";
$tdcount++;
}
echo "</tr>";
}
echo "</table>";
?>