Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
02-26-2007, 08:50 PM #1
Looking for suggestions on method to order records.
I'm working on a Photo Gallery and currently working on a way order The photos. I've set up the following fields: Title, Description, photo_url, display_order. What I'm doing is using the display order to set the order the photos are displayed
Now here's the problem I'm running into. I have a gallery that has a bunch of photos and I only care about setting the order on say 5 of the photos and don't care about the order of the rest so I enter 1-5 in display_order on those 5 records. When I issue the SQL search "order by display_order" all the records with null in the display_order are comming up first, rather then the 5 records with the 1-5 in display_order.
Any suggestions on how to get those 5 records to display first and in order?
02-26-2007, 09:05 PM #2
- Join Date
- Sep 2005
- Thanked 36 Times in 35 Posts
02-26-2007, 09:50 PM #3
"order by (display_order IS NULL), display_order" did the trick, have never seen an order by done like that.