I have a bookmark table with a bookmark type field which has type int(11).
To sort my bookmarks by type i can execute a simple query:
select * from bookmarks order by type
Works great.
Except this sorts bookmarks by integer type.
In my gui i convert the integer type to a string representation:
1=Great
2=Bad
3=Wow
...
The above query results in:
bookmarks of type Great
bookmarks of type Bad
bookmarks of type Wow
because the bookmarks are sorted on integer type.
I would like to get the result:
bookmarks of type Bad
bookmarks of type Great
bookmarks of type Wow
How can i sort on the string representation of the integer type without changing the field type and not losing handy query features like pagination?