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

Re: [chris] Correct code for sort Order

By kitka - January 25, 2010

ok here the .php files....
she removed a few others that were out of order on the weekend>

i also double checked in the admin area jmust to make sure the first one wasn't a featured lsiting which would show it first.
jim albert
Attachments:

index4.php 14K

listings.php 10K

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