/home » workblog

Entries for the ‘MySQL’ Category

Natural Sorting for MySQL

MySQL doesn’t provide a way to perform natural sorting on a string, so if you have numbers in your data you may get results like this
Product 110
Product 120
Product 13
Product 140
There are a lot of hacks available, but all of the ones I’ve seen only work in specific circumstances. The only comprehensive solution I found to [...]

Passing dates and times between PHP and MySQL

Richard Lord wrote a good article explaining the various ways of handling dates and times with PHP and MySQL.