[eluser]R. Oerlemans[/eluser]
[quote author="jedd" date="1254072339"]There's the old + 0 trick, to force the field to think that it's numeric - I think that's the most common way of dealing with this.
Two things to note - you'll probably have to tell AR to not try to escape your order by clause (read up on this - I don't use AR so I'm not familiar with its foibles).
Secondly - check, using EXPLAIN perhaps (?), but certainly by reading up in the manual - but under some circumstances, usually aliased or some other thing I've forgotten, your INDEX columns can't use their index anymore. This might be irrelevant here, but if you see a big performance hit, remember this.[/quote]
Thanks, how can i use the + 0 trick in this case, I can try that one. But don't know how to do this in AR.
[quote author="jedd" date="1254072339"]
EDIT: Oh, hang on, are the 'MB/s' strings stored in the same column? If so, design your database properly, and try again. If not, then all well and good. I have no idea what happens when you start treating an alphanumeric field, especially one that starts with a number, as a plain numeric value. Something for you to experiment with, huh. Oh, and if you do design again, measure things in bytes, and convert to human readable at the presentation stage, not at the storage stage.[/quote]
The 'MB/s' is just from the PHP (<li><a href="/abonnementen/snelheid/<?= $speed['snelheid']; ?>"><span>></span> <?= $speed['snelheid']; ?> Mb/s</a></li>).