Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Sorting problem
It is probably an easy to solve problem.
I have some numbers (10000, 1900, 1200, 3400) in custom_1 and try to sort corresponding articles by <txp:article_custom sort="custom_1 asc/desc" />
, but the sorting brings not the right order up. So descending is something like that:
3400
1900
1200
10000
and ascending
10000
1200
1900
3400
So there it seems like sorting works for the first four digits.
I already changed the data_type “ALTER TABLE textpattern MODIFY custom_1 INT;” and as the MySQL documentation says I do not have to change the values or something else: “When you change a data type using CHANGE or MODIFY, MySQL tries to convert existing column values to the new type as well as possible. “
Where to look?
Offline
#2 2010-07-18 13:11:25
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: Sorting problem
A snippet copied from cantrememberwhere: sort="(custom_1+0) asc"
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Sorting problem
uli wrote:
A snippet copied from cantrememberwhere:
sort="(custom_1+0) asc"
wow, I don´t understand it, but it works. Thanks a lot!
Offline
Pages: 1