Changed mysql functions to mysqli functions

This patch is an initial fix for the mysql functions being deprecated in php 5.5. It just changes the `mysql` functions to use their `mysqli` counterparts.

At a later date, we should probably use the improved features of this extension (prepared statements etc).

This patch will cause webdip to be at least run on php 5.0 or higher.