While Loop Not Returning 1st Record
Posted: Sat Jun 03, 2006 8:09 am
Weirdan | Please use
What have I messed up?
thanks
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
$query = "SELECT * FROM thunde9_thunderhill.journals ORDER BY 2 DESC";
// ***The Query should return 4 records - records are verified via MYSql Query Browser all four show up****
$result = mysql_query($query)
or die ("Couldn't Execute Query.");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$animaltype="Ranch Observations";
// ****Title displays correctly
echo "<h1 align='center'> <font color='#EEE4BC'>$animaltype</h1>";
echo "<div align='center'>";
echo "<table border='1' bgcolor='#EEE4BC'>";
// ***1st Record or Title Shows Correctly
echo "<tr> <th>Date Created</th>
<th>Created By</th>
<th>Observation</th>
</tr>";
// ****for some reason this only displays records 2,3,4 omitting record 1
while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<tr>
<td align='center'>$datecreated</td>
<td align='center'>$createdby</td>
<td width='300' align='center'>$journalentry</td>
</tr>";
}thanks
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]