Originally Posted by Dan
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.