Category Archives: mysql

Selecting data in a specific date range

Sometimes, you have to return all objects created in a specific date range, e.g. you want to return all posts created in the last thirty days. Thanks to the nice functions for date operations provided by MySQL this task is simple: $this->Post->findAll( ‘WHERE Post.created >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)’);

Using UTF-8 as encoding for the database connection

I already wrote about this topic some time ago. In that post I described an approach using the configuration file of MySQL, and mentioned casually that you could execute “SET NAMES utf8” if you do not have access to the MySQL configuration file. But I did not show a solution for that case… Well, today […]

Oh my blob!

I never used blobs before with MySQL, and so I had to learn painful that there are several types of blobs available in MySQL: TINYBLOB, BLOB, MEDIUMBLOB and LONGBLOB. And that is the way I had to learn it: In my app the user can upload files, and these files are stored in the database. […]

The thing with the euro sign

Yesterday, Kabuto asked in the IRC whether someone is using UTF-8 for the MySQL databases and if they experienced some problems with the euro sign. Yes, I use UTF-8 and I also store the euro sign in my database, and I assumed it works for me. But that was an illusion, the euro sign was […]

Trouble with utf-8

Yesterday, I had some trouble with utf-8. The character set of my tables is utf-8, and I use utf-8 as encoding for my pages, too. No problem, you would think (and it was no problem up to now). But yesterday, I noticed that special characters like öüä are not displayed correctly. I do not know […]

A lot of changes in trunk

Yesterday, a lot of changes have been made to trunk. Here the changes I noticed: there is a new constant called CAKE_SESSION_STRING in core.php app/controllers/components/db_acl.sql has been removed (it is the one I used for my unsuccessful dbAcl experiments *g*) AjaxHelper::linkToRemote() is now deprecated, it is replaced by AjaxHelper::link() dbAcl has been updated, so it […]