Using LEFT OUTER JOIN correctly with two predicates.

On a little project I’m working on, I needed to LEFT OUTER JOIN table ‘a’ with table ‘b’ – “Show the user all the societies they have not yet joined.”, but I had two predicates to work with, a user ID.

My table ‘a’, has a list of societies a user can join, within table ‘b’, the users chosen societies are stored, with the foreign key being the ID of the society. With each user being unique, my query had to take this into account. Continue reading

jQuery and PHP username/email availability checker

My username/email availability checker is an improvement to this one (why reinvent the wheel?). There was a few syntax errors and the MySQL connection wasn’t as secure as PDO one. So, if you have a contact form that requires an email/username check, this will do just that. Continue reading

Disable the element.

Enable the element.

Recommended database.php configuration for MAMP/CakePHP 2.x

As there seems to be an error with my MAMP running on the default Apache port (80), I switched to the MAMP Apache/MYSQL default ports (8888/8889). Once I swapped the configuration over, my CakePHP application could no longer connect to the database.

After a bit of messing around/tweaking, I finally got it to work. Here is the recommended CakePHP 2.x Database.php code: Continue reading