I am trying to upgrade to mysql 4, and so have been reading anything I could get my hands on about the new version before I actually do the upgrade.

The mysql manual at http://www.mysql.com/doc/U/p/Upgrading-from-3.23.html says:

"The old C API functions mysql_drop_db, mysql_create_db and mysql_connect are not supported anymore..."

Does anybody know about mysql_connect() not being supported in 4.0?

mysql_connect() is the primary way by which I connect to mysql, and it's not supported now, what is the new way to connect?

Thanks.

Richie.

    As far as I am aware, only with PHP 4.1.0 (or higher) can you use MySQL 4 (and above); the API was rewritten for whatever reason, but PHP 4.1.0 solves the problems (at least that's what it says in the changelog).

    Deprecated doesn't mean it doesn't work - it's just a clue that is may not work in the future.

    Why don't you go for it and let us know?

      I think I'll stick with mysql 3.23 for now. I really don't have a lot of time to experiment with undocumented issues in the new mysql 4.

      I'll look into upgrading to php 4.1.

      Thanks.

      Richie.

        Why not use mysql_pconnect()? This provides you with a persistent connection to your database.

          Well, mysql_pconnect() introduces overhead in some cases so it's better to use which ever method (connect or pconnect) is best in a given situation.

          I'm running PHP 4.1.0 and MySQL 4.0.0-alpha on my local deve server with nary a hitch or hiccup over mysql_connect() being deprecated. Prior to 4.1.0 I also ran 4.0.6 with MySQL 4.0.0-alpha with no problems.

          -geoff

            • [deleted]

            "Well, mysql_pconnect() introduces overhead in some cases so it's better to use which ever method (connect or pconnect) is best in a given situation."

            euh? overhead?

              • [deleted]

              The names of the functions in the C API are irrelevant. PHP's function names are not related to the C API function names.

              When the C API names change, PHP will adept their code, but the mysql_connect() in PHP will remain.

                Any idea on when the next release of MySQL 4.x is? On their website, they say Q4/2001, but I believe that ship has sailed...

                  Write a Reply...