Отображать каждое значение поля DISTINCT только один раз, используя цикл
SELECT listTitle, listLength, listCmt, listDt, mBCFName, mBCLName, moAmt, moDtOff
FROM User U, Listing L, Merchant M, MerchantOffer MO
WHERE U.uID = L.uID
and L.listID = MO.listID
and M.mID = MO.mId
ORDER BY listDt DESC;
Это цикл foreach ()
$result = $sth->fetchAll(PDO::FETCH_ASSOC);
foreach($result as $row)
{
echo "<div class='listing'>";
print '<br>Title: ' . $row['listTitle'] . '<br>Comment: ' . $row['listCmt'] .
'<br>Date: ' . $row['listDt'] . '<br>Offer By: ' . $row['mBCFName']. ' ' .$row['mBCLName']. '<br> for: ' . $row['moAmt'];
echo "</div>";
}
производит:
В основном то, что я хочу, это:
Title: Apple iPhone 4S (listTitle)
Days: <some day amount <listLength>
Comment: some comment <listCmt>
Offer By: some user <mBCFName mBCLName>
Offer: 19.99 <moAmt>
Date: 10/03/2011 < moDtOff>
Offer By: some user <mBCFName mBCLName>
Offer: 19.99 <moAmt>
Date: 10/03/2011 < moDtOff>
Offer By: some user <mBCFName mBCLName>
Offer: 19.99 <moAmt>
Date: 10/03/2011 < moDtOff>
Offer By: some user <mBCFName mBCLName>
Offer: 19.99 <moAmt>
Date: 10/03/2011 < moDtOff>