I have a weird problem where mysql_
limits results from a query, but only when it's in a while loop & adding ORDER BY listing_name ASC
. Here's an example:
$listings = mysql_query("SELECT * FROM listings");
$listingcount = mysql_num_rows($listings);
$listingcount
returns 157 rows in the listings table.
And here's what happens in the while loop.
$listings = mysql_query("SELECT * FROM listings ORDER BY listing_name ASC");
while($listingresult = mysql_fetch_assoc($listings)){
//grab some data from the query using $listingresult
//e.g: $somedata = $listingresult['listing_name'];
echo "some data here:". $somedata;
}
This only echos 97 rows. None of the values in listing_name
are NULL, empty etc they all contain & start with letters.
What am I missing here? It doesn't seem right