Archive for the ‘CakePHP’ Category

CakePHP: catching errors in Model->query()

In my recent CakePHP application I use some custom SQL queries that I fire at the database using the $model->query($sql) syntax. Works great, until you have an error in your $sql. I tried the obvious error handling with try … catch: try {   $this->Model->query(’INSERT INTO model WHERE id=invalid’); } catch (exception $ex) {   [...]

More »

CakePHP not showing new tables when using cake bake

When newly created tables don’t show up when using the console application cake bake then it’s time to clean out the model cache. The model cache is located in /app/tmp/cache/models/

More »