Jump to content

Recommended Posts

I have a table with thousands of rows, I want to order the rows by the field 'age'.... I set it to "varchar" because some of the values are age ranges (60-65). Most of the rows don't show up when I select or order by age. Even "SELECT * FROM table WHERE age = '70'" brings up nothing. I've checked to make sure the rows are there... even copy and pasted the age values!

 

The only thing that fixed the issue was setting the type to an integer type but then the age ranges disappear.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/188521-order-by-number-string/
Share on other sites

If I use "SELECT * FROM table WHERE age LIKE '%76%'", I can get them to show up, but this isn't a good solution to my problem. I've checked for spaces and even tried changing it....

 

I get the same results in phpMyAdmin as in my php code.

 

 

PS..... MySQL 5

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.