Entry
Why is my first record never showing up?
Sep 6th, 2003 01:26
Chukwuma Uzoma-Nze, Delaney Hee Kuan Weng, Kevin Nonya,
your first record never come out?? shouldn't be. mayb U can check
the "FOR" statement......
The problem is not the for or while or whatever statement but WHERE you
put the statement that retrieves the actual data from the database:
This will not get the first row"
********************************************
$query = mysql_query("select bla, bla2, bla3 from BLA",$conn);
$queryArray = mysql_fetch_array($query);
while($queryArray = mysql_fetch_array($query))
{
print "$$queryArray[0]<br>";
print "$$queryArray[1]<br>";
print "$$queryArray[2]<br>";
}
This WILL:
********************************************
$query = mysql_query("select bla, bla2, bla3 from BLA",$conn);
while($queryArray = mysql_fetch_array($query))
{
print "$$queryArray[0]<br>";
print "$$queryArray[1]<br>";
print "$$queryArray[2]<br>";
}
Notice how the first mysql_fetch_array statement is missing? Well, that
is the cause of the dissappearing row. Each statement of that eats away
at one row! This is not a bad thing it can be useful when you want to
display the first row seperatley b4 looping through the rest!
Courtesy The DEBAUN Co. cjunze@hotmail.com