Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-01-2013, 12:11 PM   PM User | #1
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,521
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Have most of you upgraded to MySQLi ?

A very powerful change appears to be the buffering:

Quote:
PHP applications can navigate freely through buffered results.
Navigation is fast because the result sets are held in client memory. Please, keep in
mind that it is often easier to scale by client than it is to scale the server.
But now this is something new to get my head around ( as if I didn't have enough to do )

Did you re-write all your scripts ?


.
__________________
If you want to attract and keep more clients, then offer great customer support.

Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
jeddi is offline   Reply With Quote
Old 02-01-2013, 07:23 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Yep, fully converted my mysql aggregate drivers to mysqli with version 5.1. Also have a PDO one to be used with things like oracle. So the only script I rewrote was creating the mysqli driver, then changing the configs to load the mysqli driver instead of the mysql. Done and done.
Unless something has *drastically* changed with HTTP (which it hasn't), than I think you may be interpreting that quote differently than you should be. The "client" here is the server processing the PHP code, while the "server" here is the MySQL server. So this isn't the same as a remote client connect to your web server. So there's really nothing new for you to worry about, as your visitors wouldn't see any changes on their end whatsoever. This is just a fancy way of saying that it will, on average, perform better than the mysql did, which in turn would perform better than PDO would.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 02-01-2013, 07:46 PM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,455
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
I had started using mysqli_ for new scripts a while ago taking advantage of some of the additional functionality that interface provides such as OO rather than procedural and PREPARE/BIND.

Just recently finished doing quick conversions of all my old scripts - basically just adding the 'i' and switching the parameters around the other way.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 02-01-2013, 08:19 PM   PM User | #4
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,521
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Thanks for your comments.

I shall start trying to right in OOP but I hope that my
current scripts can be converted to MySQLi without too much hassle

.
__________________
If you want to attract and keep more clients, then offer great customer support.

Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
jeddi is offline   Reply With Quote
Old 02-01-2013, 08:56 PM   PM User | #5
elem
New Coder

 
Join Date: Sep 2011
Posts: 35
Thanks: 18
Thanked 1 Time in 1 Post
elem is an unknown quantity at this point
so is MySQLi better than PDO ? if so, how ? I'm after changing myself to PDO, is there any advantage that MySQLi has over PDO ?
elem is offline   Reply With Quote
Old 02-01-2013, 09:26 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
See the link in my sig for which to use. There will be a table that shows some of the feature comparisons.

MySQLi uses native drivers, so it is more feature rich and will provide better performance overall. PDO is an abstraction layer, so as long as you stick to non-proprietary SQL code, than you can swap the drivers to use on different database types. So the answer is, if you plan to stick completely with mysql, than use the mysqli. If you have potential to use oracle or sqlserver as well as mysql, than use PDO.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
elem (02-01-2013)
Old 02-01-2013, 10:09 PM   PM User | #7
elem
New Coder

 
Join Date: Sep 2011
Posts: 35
Thanks: 18
Thanked 1 Time in 1 Post
elem is an unknown quantity at this point
I see .. and how about SQL injection ? cause that was primary reason I went for PDO, is MySQLi handling that in a similar way ?
elem is offline   Reply With Quote
Old 02-01-2013, 10:30 PM   PM User | #8
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by elem View Post
I see .. and how about SQL injection ? cause that was primary reason I went for PDO, is MySQLi handling that in a similar way ?
PDO and MySQLi both provide prepared statements which are immune to SQL Injection.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:10 PM.


Advertisement
Log in to turn off these ads.