Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts

    Have most of you upgraded to MySQLi ?

    A very powerful change appears to be the buffering:

    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.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    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/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    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.

  • #5
    New Coder
    Join Date
    Sep 2011
    Posts
    35
    Thanks
    18
    Thanked 1 Time in 1 Post
    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 ?

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    elem (02-01-2013)

  • #7
    New Coder
    Join Date
    Sep 2011
    Posts
    35
    Thanks
    18
    Thanked 1 Time in 1 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 ?

  • #8
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •