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 »
I am a .NET programmer first and foremost. But in my spare time I like to play around with PHP, Erlang, Haskell, F#,