Updated to mySQLi extension

Adapted the source code in order to use PHP mySQLi extension instead of
the old mySQL one.
Merge pull request #3 from kirirur/master

Updated to mySQLi extension