Baking with XAMPP on Windows

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

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

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

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.
Read the rest of this entry »

Alternative icon for Eclipse IDE

July 8th, 2009

Each year we have the pleasure of switching to a new version of Eclipse. And by pleasure I mean both shades of the word. Cool new features and boring migration. I usually fight my laziness for quite some time and migrate my projects gradually. Thanks folks for keeping Eclipse isolated so that I can run both versions simultaneously. I’m getting to my point now: I needed a new icon that would distinct the new version from the old one.
Read the rest of this entry »

Duplicating sets of radio buttons with jQuery

July 6th, 2009

We all love the “add more” links for adding more form items to forms. More pictures to upload, more categories to add. You just name them with empty square brackets and then clone them.

  1.  
  2. <input type="file" name="file[]" value="">
  3. <a href="" id="addMoreUploads">add more</a>
  4.  

But what if you need to clone sets of radio buttons? You end up with a single group of radio buttons - not with a group of radio button groups.
Read the rest of this entry »

MySQL comparison catch: ‘abc’ = 00

May 25th, 2009

I was shocked to find a weakness in my authentication library today. It was possible to get around the password check if you knew the username. All you had to do was to enter 00 as the password. Or you just entered 00 as the username too and you got authenticated as the first user.
Read the rest of this entry »