Query not selecting all records
Posted: Fri Jun 25, 2010 6:33 pm
I have the following code:
This does as expected except that it does not pull in all records. If I do a DESC order then the first record is not displayed but if I do as above and do a ASC then I do not get the last record. If I do neither then I may as well do a DESC.
Why?
Code: Select all
<?php
$getarticle = $connector->query('SELECT ID,title,creator,created,last_edited FROM cmsarticles ORDER BY created ASC');
$articles = $connector->fetchArray($getarticle);
$creator = $connector->query('SELECT user FROM cmsusers');
$creators = $connector->fetchArray($creator);
while ($articles = $connector->fetchArray($getarticle))
{
echo '<p><a href="article.php?id='.$articles['ID'].'&act=v">';
echo $articles['title'];
echo '</a>';
echo '<br>Created by: '
.$creators['user'].' | Created on: '
.substr($articles['created'], 0, 10).' | Last edited: '
.substr($articles['last_edited'], 0, 10);
echo '</p>';
}
?>
Why?