Archive for September, 2009

Baking with XAMPP on Windows

Monday, September 14th, 2009

I’m not sure if it’s just my set-up but when I run cake.bat and say, try to bake a model I get

  2. Fatal error: Call to undefined function mysqli_connect() in C:\…\cake\libs\model\datasources\dbo\dbo_mysqli.php on line 73

The reason is that php.exe when run from a command line uses a different php.ini than PHP that’s run as an Apache module. To fix this edit cake.bat and add -c"C:\xampp\apache\bin\php.ini". This is the path where XAMPP placed php.ini.

Getting rid of JOINs in updateAll() query

Sunday, September 13th, 2009

I guess I haven’t mastered the model relationships enough in order to appreciate them – and use correctly. On one hand they seem to be really cool and provide an easy access to linked database records while on the other hand, they just seem to stand in the way too often.