We help IT Professionals succeed at work.

How do you use a variable in MySql  to establish sort order?

rnicolais
rnicolais asked
on
242 Views
Last Modified: 2010-03-19
I would like to use a variable from a list to establish a sort order. For example I would like to give the web user the option to sort by either city or zip code. Simply putting the variable name in the 'Order By' statement doesn't appear to work.
Comment
Watch Question

Commented:
Seems like it should work.  What happens when you try?
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.