I've been having problems with a script skipping the first record from a list of records displayed by date. After a little research and guidance, it seems that mysql_data_seek is how to get the data pointer to view the first record, and not begin from the 2nd. But I cannot figure out how to use the function in my script. The PHP manual is no help to me, it doesn't explain it well enough. For this case, what's the right way to implement it?
$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
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++;
}
}
// close up table
if ($tdcount!= 1) {
while ($tdcount <= $numtd) {
echo "<td> </td>";
$tdcount++;
}
echo "</tr>";
}
echo "</table>";
?>