Snow Leopard, Zend Framework and MySQLi Problem

I spent a good hour banging my head against the desk this evening trying to work out why Zend Framework row objects have stopped working after upgrading to Snow Leopard and installing the new iPhone SDK.

I traced all the way though to the Zend_Db_Statement_Mysqli class which giving the following error:

Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in Zend/Db/Statement/Mysqli.php on line 205

I was half way installing the macports PHP package when I thought I should probably try a different adapter which worked! So if you’re having difficulties, try the PDO_MYSQL driver instead.

Finding Your Way with an iPhone and PHP

The iPhone has undoubtedly revolutionised mobile phone technology, providing users access to vast amounts information wherever they are and more importantly information about where they are.

One of the projects I have been working is BeerMap, a location aware iPhone application which shows you nearby pubs, how people have rated beer and lets your add to the database by uploading reviews and images.

My role in this project was to produce the web service to manage all of the information, and I thought it may be useful to give a summary of the technologies used.

PHP & The Zend Framework

The Zend Framework is an extensive PHP library providing the MVC approach to code structure which is also recommended for iPhone development.

I also heavily extended the Zend_Controller_Action class to incorporate authentication and context switching depending on the response type needed.

MySQL Stored Procedures

All our data is stored in a MySQL database, so it was logical to also create a mechanism within the database to calculate distances depending on longitude and latitude. This calculation can be relatively expensive so I am looking a ways to further optimise this process, however it appears to be working relatively efficiently at the moment.

Plists

Web services generally will provide a response in XML or JSON, however using these response formats would require additional libraries to be included within the iPhone app, increasing its size and complexity. However, by generating a Plist response, the iPhone can read this without any complex parsing or processing.

For this we modified a version of the CFPropertyList library and added a better mechanism for guessing variable types which I hope will be integrated into the original library at some point soon.

Further Information

Above is just a very brief summary of the technologies used, however please contact me for more information and take a look at the websites below:

Photo Credit: Will Ockenden