Announcement

Collapse
No announcement yet.

Huge PHP Error: use mysqli or PDO instead ??????

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

  • Huge PHP Error: use mysqli or PDO instead ??????

    This happened suddenly today...


    Database error in vBulletin :

    mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
    /home/xxx/public_html/ forums/includes/class_core.php on line 317

    The board is just erroring all the time with this.

  • #2
    Try putting an "i" at the end of mysql in config.php like so:

    Code:
    //    ****** DATABASE TYPE ******
        //    This is the type of the database server on which your vBulletin database will be located.
        //    Valid options are mysql and mysqli, for slave support add _slave.  Try to use mysqli if you are using PHP 5 and MySQL 4.1+
        // for slave options just append _slave to your preferred database type.
    $config['Database']['dbtype'] = 'mysqli';

    Comment


    • #3
      thanks donald that has worked, but why would I suddenly be getting that error after 2 years of hosting without that problem?

      Comment


      • #4
        Your host probably upgraded his mysql server, newer versions use msqli (the "i" stands for improved) so you should get better performance.

        Comment


        • #5
          vBulletin doesn't support PDO. You must use MySQLi. The mysql extension will be removed from PHP in future versions.
          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


          • #6
            Originally posted by thedvs View Post
            thanks donald that has worked, but why would I suddenly be getting that error after 2 years of hosting without that problem?
            It means they upgraded your php version to php 5.5, without informing you apparently.
            Baby, I was born this way

            Comment


            • #7
              Originally posted by Paul M View Post

              It means they upgraded your php version to php 5.5, without informing you apparently.
              This is a possibility as php5 no longer works with mysql but there is nothing to stop a host upgrading the database to mysqli without touching PHP, indeed I use mysqli with PHP3.3

              Comment


              • #8
                There is no such thing as "upgrading a database to mysqli", so no host could perform such an action.

                I seriously doubt you are using php 3.3 either.
                Baby, I was born this way

                Comment


                • #9
                  Originally posted by Paul M View Post
                  There is no such thing as "upgrading a database to mysqli", so no host could perform such an action.

                  I seriously doubt you are using php 3.3 either.
                  You can upgrade your mysql database to a mysqli database in easyapache simply by ticking the "i" box, done it many times.

                  Thanks for pointing out my obvious typo, actually I upgraded to 5.4 last night.
                  Attached Files

                  Comment


                  • #10
                    Originally posted by donald1234 View Post
                    You can upgrade your mysql database to a mysqli database in easyapache simply by ticking the "i" box, done it many times.
                    All this does is add the mysqli libraries to PHP. It doesn't actually upgrade databases and MySQL doesn't change. The only thing that changes are the libraries available in PHP.
                    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


                    • #11
                      mysqli is just the way PHP communicates with the MySQL database, it does not change the database itself.

                      Comment


                      • #12
                        Originally posted by donald1234 View Post
                        You can upgrade your mysql database to a mysqli database in easyapache simply by ticking the "i" box, done it many times.
                        No, you cannot upgrade your database - all that does is change the client library you use to connect. It makes no changes to the database.

                        Baby, I was born this way

                        Comment


                        • #13
                          Originally posted by Wayne Luke View Post

                          All this does is add the mysqli libraries to PHP. It doesn't actually upgrade databases and MySQL doesn't change. The only thing that changes are the libraries available in PHP.
                          I'm upgrading 4.2.2 to 4.2.5 - I notice in the config.php that it has mysqli instead of mysql. It will be upgraded to the latest 5 at some point soon.

                          So if my server is upgraded to add the mysqli option, then would my other vb 3.8.8 site still work since it uses mysql? Sounds like it would, but just want clarification. That site will be upgraded to the latest 5 soon as well.

                          Comment


                          • #14
                            The versions of PHP supported by vBulletin 4.2.5 and higher do not support the mysql library. You must have the mysqli library installed in PHP.

                            You should use mysqli with vBulletin 3.8.X as well. You will need to upgrade that site to at least vBulletin 3.8.11.

                            Please note that with the release of vBulletin 5.6.0 next year, the minimum required version of PHP will be 7.2.X. Neither vBulletin 3 or 4 support this version of PHP.
                            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


                            • #15
                              Originally posted by Wayne Luke View Post
                              The versions of PHP supported by vBulletin 4.2.5 and higher do not support the mysql library. You must have the mysqli library installed in PHP.

                              You should use mysqli with vBulletin 3.8.X as well. You will need to upgrade that site to at least vBulletin 3.8.11.

                              Please note that with the release of vBulletin 5.6.0 next year, the minimum required version of PHP will be 7.2.X. Neither vBulletin 3 or 4 support this version of PHP.
                              What is the upgrade sequence to prevent any crashing for vbulletin, php and mysqli?

                              If just mysqli is added/upgraded on the server, will the vb 3 and 4 continue to work since they are mysql? If so, that seems to be the first step on the path to upgrading.

                              Comment

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