Correct code for sort Order

14 posts by 2 authors in: Forums > CMS Builder
Last Post: January 25, 2010   (RSS)

By kitka - January 25, 2010

Any ideas from my last comment?
jim albert

By Chris - January 25, 2010

Hi kitka,

I'm looking at your page at http://www.jodyandgeorge.com/index4.php and here are the prices and "sold" statuses that your page is displaying:

$168,000
$69,000
$117,000
$119,000
$145,000
$149,000
$179,800
$205,000
$205,000
$219,000
$249,900
$279,500
$155,000 SOLD
$190,000 SOLD
$259,900 SOLD

Everything seems perfect except that first listing.

Can you please post the complete PHP source code (as an attachment) for that page so I can see what might be going on?
All the best,
Chris

By Chris - January 25, 2010 - edited: January 25, 2010

Hi kitka,

Thanks. I took a look at your source and noticed that the price is output on the page with number_format():

<?php echo number_format($listing['price']) ?>

This leads me to believe that there is something different about that first listing (num=10, 229 MAIN ST.)'s price field. Please login to your CMS Builder, check any of your other listings to see exactly how the price is entered, then edit the offending record and re-enter the price. There's probably a missing/extra comma or a spurious dollar sign or other character which is causing the ordering problem, but is getting filtered out before being displayed because of the call to number_format().

Does that help?

P.S. Featured listings won't show first because we haven't put that field in our orderBy.
All the best,
Chris