Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record starting at row 0 does not display 1

Status
Not open for further replies.

humbleprogrammer

Programmer
Oct 30, 2002
315
US
Hi,

I am new to PHP and am having trouble getting the record at row 0 to display in my query. All other rows display accept for row 0. Below is my code. Any help is GREATLY appreciated.

<?php
include(&quot;Connection.php&quot;);
$strQuery = &quot;SELECT * FROM user_auctions WHERE user_id = &quot;.$user_id.&quot;&quot;;
$row = mysql_query($strQuery) or die(&quot;Error&quot;.mysql_error());
if(mysql_num_rows($row)>0)
{
$rs=mysql_fetch_array($row);
while($rs = mysql_fetch_array($row)) {
$title=&quot;$rs[title]&quot;;
$date_added=&quot;$rs[date_added]&quot;;
$auction_id=&quot;$rs[auction_id]&quot;;
?>
<tr>
<td width=&quot;7%&quot;><font size=&quot;2&quot;><a href=&quot;modify_auction.php?auction_id=<?=$auction_id?>&type=View&quot; target=&quot;_blank&quot;><img src=&quot;Images/MagGlass.gif&quot; width=&quot;20&quot; height=&quot;23&quot; border=&quot;0&quot;></a></font></td>
<td width=&quot;7%&quot;><a href=&quot;edit_auction.php?auction_id=<?=$auction_id?>&quot; target=&quot;_blank&quot;><img src=&quot;Images/updateColumn.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot;></a></td>
<td width=&quot;8%&quot;><a href=&quot;view_auctions.php?Delete=Yes&auction_id=<?=$auction_id?>&quot;><img src=&quot;Images/deleteColumn.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot;></a></td>
<td width=&quot;21%&quot;> <font size=&quot;2&quot;>
<?=$date_added?>
</font></td>
<td width=&quot;57%&quot;> <font size=&quot;2&quot;>
<?=$title?>
</font></td>
</tr>
<?php
}
}
else
{
echo &quot;No auctions found!&quot;;
}
ob_end_flush();
?>
 
If you mean that you cannot get the first row of the query return to display, it is because you are performing mysql_fetch_row() twice in succession:

       $rs=mysql_fetch_array($row);
        while($rs = mysql_fetch_array($row)) Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top