ОБНОВЛЕННЫЙ SQL
SELECT listTitle, listLength, listCmt, listDt,mBCFName, mBCLName, moAmt
FROM User U
INNER JOIN Listing L on (U.uID = L.uID)
INNER JOIN MerchantOffer MO ON (L.listID = MO.listID)
INNER JOIN Merchant M on (M.mID = MO.mId)
GROUP BY listTitle
ORDER BY listDt DESC
LIMIT 0,5
Слегка обновленный PHP
<?php
$result = $sth1->fetchAll(PDO::FETCH_ASSOC);
require_once('inc/php/timeAgo.php');
echo $then;
foreach($result as $row)
{
echo "<div class='listing'>";
print '<br>Title: ' . $row['listTitle'] . '<br>Comment: ' . $row['listCmt'] .
'<br><br>' . $days . ' days ' . $hours . ' hours ago' . '<br><br>' . '<br>Offer By: ' . $row['mBCFName']. ' ' . $row['mBCLName'] . '<br> for: ' . $row['moAmt'];
echo "</div>";
}
unset($sth1);
?>
Дает вывод как:
http://i.stack.imgur.com/pNfU5.png
Это действительно должно выводить ... например:
Title: Apple iPhone 4S
Comment: need this one quick!
15254 days 15 hours ago
Offer By: Diana Matthews
for: 194.99
Offer By: John Dickinson
for: 185.99
Почему он ТОЛЬКО получает ПЕРВУЮ запись и останавливается?