Announcement

Collapse
No announcement yet.

What's the difference between MySQL and MySQLi?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What's the difference between MySQL and MySQLi?

    I went ahead and installed a new copy of 3.6.7 to my localhost, which uses the latest versions of PHP and MySQL. Going through the config file, it recommended that MySQLi be used with the latest offerings from both. Anyway, I'm just wondering, what is the difference? Is MySQLi better in some ways?
    Forums

  • #2
    MySQLi is designed to work with MySQL 4.1.3 or higher and gives access to more advanced features in MySQL. It requires PHP 5.0 to use. It also gives you more control because you can change MySQL settings using MySQLi without stopping and starting the MYSQL server.

    The MYSQL connecting library is designed for older versions of MySQL.

    I use MySQLi on all my installations if it is present.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      Does vB actually use any functionality from MySQLi? I read that using MySQLi for normal queries and such is much slower then using MySQL.

      Comment


      • #4
        According to this: http://www.johnjawed.com/benchmarks/index.php

        MySQL is faster.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #5
          Originally posted by Wayne Luke View Post
          According to this: http://www.johnjawed.com/benchmarks/index.php

          MySQLi is faster.
          The conclusions the article draws are this:

          mysqli_stmt > mysql_query > mysqli_query > mysqli_multi_query
          So actually, for vBulletin, MySQL (not i) is faster. mysqli_stmt requires binding each column of the result to a separate variable manually (thus making it more of a pain and harder to abstract), as opposed to the standard *_query() and *_fetch_array() which returns an associative array.
          Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

          Comment


          • #6
            I thought *_fetch_array() does NOT associate, it was *_fetch_assoc() that does the association?
            Best Regards,
            Andy Huang

            Comment


            • #7
              Originally posted by daemon View Post
              So actually, for vBulletin, MySQL (not i) is faster. mysqli_stmt requires binding each column of the result to a separate variable manually (thus making it more of a pain and harder to abstract), as opposed to the standard *_query() and *_fetch_array() which returns an associative array.
              I actually meant to put MySQL. The other was a typo. I still personally feel that the benefits now and in the future outweigh the minor speed decrease. Each person will have to make that evaluation for themselves though.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API - Full / Mobile
              Vote for your favorite feature requests and the bugs you want to see fixed.

              Comment


              • #8
                Originally posted by Andy Huang View Post
                I thought *_fetch_array() does NOT associate, it was *_fetch_assoc() that does the association?
                The second argument of mysql_fetch_array() is an integer found in the constants MYSQL_ASSOC (fetch an associative array), MYSQL_NUM (standard array), and MYSQL_BOTH (the default). The same is true for mysqli_fetch_array() and the appropriately-named constants.
                Last edited by daemon; Fri 1st Jun '07, 9:45am.
                Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X