Jump to content

[SOLVED] Skip characters in sort by?


Boo-urns

Recommended Posts

I was wondering what the method would be to skip certain characters in a sort by?

 

SELECT name FROM foods WHERE viewable='Y' ORDER BY name ASC

 

How would i skip it if the first character in the name column starts with a quote or numbers to skip to their first character?

 

Thanks for your help!

Corey

Link to comment
https://forums.phpfreaks.com/topic/103805-solved-skip-characters-in-sort-by/
Share on other sites

Could you simply just do that query and then process the results for what you want? Or is it that your query will be astronomically large with the extra items?

 

Secondarily, if there is something unique about the entries that start with a quote or numbers, you could add an extra column to the table like 'type' and then make your WHERE class also check this 'type' category for a match as well as your viewable='Y'.

Hmmm... The first option might work bascially what I will be doing with the data being presented is to paginate all of them and there are over 2000 rows so I don't know how quick that would be.  I wasn't sure if there was a mysql function or term that I could use that I was unaware of.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.