danielleDee
Programmer
Hi!
When I display the entire results from a database table (mySQL), for some reason the 1st line is left out. My code is:
<?php
include_once ("dbc.php");
$sql=@mysql_query ("SELECT * FROM `my_desc`");
$row=mysql_fetch_array($sql);
$num_rows=mysql_num_rows($sql);
if ($num_rows < 0)
{
echo "No Results Available";
}
while ($display = mysql_fetch_array($sql)) {
$id= $display["id"];
$title= $display["title"];
$status= $display["status"];
echo($id);
echo($title);
echo($status);
}
?>
My primary key is set as auto_increment on id.
If there is 3 rows:
1, Title 1, sold
2, Title 2, sold
3, Title 3, bid
then only the rows for Title 2 and Title 3 will display.
Any ideas?
Thanks!
When I display the entire results from a database table (mySQL), for some reason the 1st line is left out. My code is:
<?php
include_once ("dbc.php");
$sql=@mysql_query ("SELECT * FROM `my_desc`");
$row=mysql_fetch_array($sql);
$num_rows=mysql_num_rows($sql);
if ($num_rows < 0)
{
echo "No Results Available";
}
while ($display = mysql_fetch_array($sql)) {
$id= $display["id"];
$title= $display["title"];
$status= $display["status"];
echo($id);
echo($title);
echo($status);
}
?>
My primary key is set as auto_increment on id.
If there is 3 rows:
1, Title 1, sold
2, Title 2, sold
3, Title 3, bid
then only the rows for Title 2 and Title 3 will display.
Any ideas?
Thanks!