Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Link sort order in categorys

Quote Reply
Re: Link sort order in categorys In reply to
The problem is that perl is non-typed. It doesn't make a distinction between "1" as an integer and "1" as a string. It decides the value in the "context" that it's working in. "eq" would be a string, and "=" would _probably_ be an integer compare.

The only way to FORCE an integer compare would be to preface the field with int() --- The only real way to guarantee it's a number compare is probably to use a mathematical operator on it ... such as $total = $varable_value_is_1 + 12 to get 13.

This is a subtlty of perl and trickery that I have to admit I'm not intimately familiar with. You might want to ask this on the perl board, since there are probably others who might know how to force that to happen who read there.

The reason it would be smoother to do inside MySQL and temporary tables, is that MySQL _is_ typed, and it would (should) watch how it makes integer vs string comparasons. Additionally, you'd get alt-links in order.



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Subject Author Views Date
Thread Link sort order in categorys Alex404 3401 Jun 2, 2000, 1:18 PM
Thread Re: Link sort order in categorys
pugdog 3319 Jun 2, 2000, 8:15 PM
Thread Re: Link sort order in categorys
Alex404 3286 Jun 5, 2000, 6:59 AM
Post Re: Link sort order in categorys
pugdog 3285 Jun 7, 2000, 6:02 AM
Thread Re: Link sort order in categorys
pugdog 3270 Jun 7, 2000, 6:07 AM
Thread Re: Link sort order in categorys
Robert 3282 Jun 7, 2000, 7:23 AM
Post Re: Link sort order in categorys
pugdog 3264 Jun 7, 2000, 10:08 PM