SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru LinhGB's Avatar
    Join Date
    Apr 2004
    Location
    Melbourne, Australia
    Posts
    902
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL5 and older PHP code (4.3.x)

    I'm setting up a new dedicated server for myself and I want to start using MySQL5 and PHP5. I can set up PHP4 and PHP5 running side by side fine, but I'm wondering if older PHP4 code could work with MySQL5. I've read that I should use MySQLi extension when connecting to MySQL5. That's fine, and I'll be doing that when I code in PHP5, but what about the older PHP4 code that still uses mysql_connect()? Will they work with MySQL5 (they currently work fine with MySQL 4.1)? I can't find much info from mysql.com or php.net and searching the forum hasn't got me anywhere. Any idea? Thanks in advance for your replies.
    "I disapprove of what I say,
    but I will defend to the death my right to say it."

  2. #2
    SitePoint Enthusiast lotrgamemast's Avatar
    Join Date
    Apr 2005
    Location
    Cheshire, England
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just before i start, im not 100% sure about any of this.

    That said id suggest you you try using the MySQLi extention with PHP4 (php_mysqli.dll, if you use windows, different for linux/mac) and see if that works. If you have to change your doe to use the mysqli_x functions then i dont think your old code will work without being modified.

    Try it out and report back

  3. #3
    SitePoint Guru LinhGB's Avatar
    Join Date
    Apr 2004
    Location
    Melbourne, Australia
    Posts
    902
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm definitely going to use mysqli with my new code and I will eventually convert my old code to PHP5/MySQL5 but it takes time, and site migration needs to be done quickly. Before I dive head first into this potential mess, I just want to check if people are having any problem with it. Thanks for your reply.

    I just did a check on a php4.3 CMS package that I use on a few sites and people have reported that it is compatible with MySQL5. I ran grep mysqli on the source code and they have none - they only use mysql_connect etc. - so that sounds very positive. I guess I'll give it a go and see what happens. Will report back when I have some results. Meanwhile, if you have any experience with this, please post here. Thanks a lot.
    "I disapprove of what I say,
    but I will defend to the death my right to say it."


Bookmarks

Posting Permissions

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