View Single Post
08-18-2012, 09:58 AM
#5
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Originally Posted by Dan View Post
I figured using a class will save me from editing every file. In theory I can just edit my db class.
It depends what you're doing outside of the class. For example, calling that escape() method is not needed if you change to using prepared statements where the query itself and the input parameters are separated.

It looks fairly trivial (you can keep the external API the same) to take your existing class and make it use MySQLi instead.

The changes would be things like the way errors are handled (looking at error properties rather than a false return value), the fetch_*() methods are slightly different for MySQLi, and (if you want it) adding in prepared statement support to your query() method.