Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1283 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Time to update my MySQL into MySQLi =(

Thread title: Time to update my MySQL into MySQLi =(
Reply    
    Thread tools Search this thread Display Modes  
08-17-2012, 08:39 PM
#1
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old

I figured using a class will save me from editing every file. In theory I can just edit my db class.

hmmph

Reply With Quote
08-18-2012, 09:58 AM
#2
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.

Reply    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed