Connecting Tech Pros Worldwide Help | Site Map

Which is the best function to exchange data with mysql?

mikek12004's Avatar
Familiar Sight
 
Join Date: Sep 2008
Location: Athens, Greece
Posts: 186
#1: Jun 16 '09
Until now I used mysql_ functions but recenlty heard something about mysqli_ functions which is supposed to be an improved versions of the previous and also saw an object oriented approached introduced in PHP 5, what's the best? Even if the object oriented approach is too complicated is it worth it to go at least to mysqli?
dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,094
#2: Jun 16 '09

re: Which is the best function to exchange data with mysql?


OOP is another issue (search for OOP on bytes in the last few days, you'll get to know all about it, don't want to start another thread on OOP).

Yes mysqli or PDO functions are better than the normal mysql function.

You won't notice a difference if it's a small app. We like PDO because of it's fetchAll() function that mysql_*() do not have.

Good luck,



Dan
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#3: Jun 16 '09

re: Which is the best function to exchange data with mysql?


Quote:

Originally Posted by dlite922 View Post

OOP is another issue (search for OOP on bytes in the last few days, you'll get to know all about it, don't want to start another thread on OOP).

Yes mysqli or PDO functions are better than the normal mysql function.

You won't notice a difference if it's a small app. We like PDO because of it's fetchAll() function that mysql_*() do not have.

Good luck,



Dan

@OP: Note PDO is a library (also OO) - not native functions like mysqli_* and mysql_*.
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: Jun 17 '09

re: Which is the best function to exchange data with mysql?


another note: MySQLi can be used as functions (like mysql_*) or as classes (like PDO)
Reply


Similar PHP bytes