Join Just Producing One Entry
I'm trying to JOIN a user to a Blog Entry in a repeat region.
There are 4 Blog Entries in the Database and it's only returning a single users blog. I want all the Blog Entries with their respective Authors(User). This is the first time I've tried to JOIN a second table to a query since updating to mysqli. Has something changed in the way queries and repeats work when JOINing?
Here is my mysqli code:
<?php
$rsBlogEntry = new WA_MySQLi_RS("rsBlogEntry",$connSiteDB,10);
$rsBlogEntry->setQuery("SELECT * FROM blogentry JOIN users ON users.userID = blogentry.blogentryUserID ORDER BY blogentryTimestamp ASC LIMIT 10");
$rsBlogEntry->execute();
?>
Here is the repeat region:
<?php
$wa_startindex = 0;
while(!$rsBlogEntry->atEnd()) {
$wa_startindex = $rsBlogEntry->Index;
?>
Title: <?php echo($rsBlogEntry->getColumnVal("blogentryTitle")); ?>
Author: <?php echo($rsBlogEntry->getColumnVal("userFirstName")); ?> <?php echo($rsBlogEntry->getColumnVal("userLastName")); ?>
<hr>
<?php
$rsBlogEntry->moveNext();
}
$rsBlogEntry->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>