1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

php 5.5.x and mysql_xxx methods

Discussion in 'PHP' started by shuman202, Jul 23, 2013.

  1. #1
    from the php 5.5.x and the future releases php won't support the old ext/mysql, however i want to upgrade from php 5.3.x to php 5.5 and i worry about that i use scripts that use the mysql_xxx methods (as opposed to mysqli_xxx or PDO)
    some of those scripts don't have any upgrade to use the mysqli_xxx or PDO
    i just want to know if i turn the display_errors off is that enough to keep using the scripts that still using the mysql_xxx method or those scripts won't work any more and to hide the error message
    best regards
     
    shuman202, Jul 23, 2013 IP
  2. liamwli

    liamwli Well-Known Member

    Messages:
    174
    Likes Received:
    16
    Best Answers:
    1
    Trophy Points:
    190
    #2

    As the functions will still be present, you'll be able to still use those scripts. If display errors is off, or error reporting has ~E_DEPRECATED in it, then the errors relating to mysql being deprecated won't show.

    You should however contact the app authors and get them to update their programs for use with mysqli or PDO.
     
    liamwli, Jul 24, 2013 IP
    shuman202 likes this.
  3. shuman202

    shuman202 Well-Known Member

    Messages:
    638
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    145
    Digital Goods:
    1
    #3
    Thank you so much your reply was so helpful for me
     
    shuman202, Jul 24, 2013 IP
  4. dedideals

    dedideals Member

    Messages:
    168
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    48
    #4
    Providing you turn error display off in the phpini file, you should be good to go. We have a script which is similar, some older style coding but nothing dangerous, so we disabled error reporting and it has been fine since.

    So just turn it off and do not worry, hopefully they will release an update at some point for you, PHP has changed versions a lot lately, .2-.3 versions in a year I believe
     
    dedideals, Jul 24, 2013 IP
  5. shuman202

    shuman202 Well-Known Member

    Messages:
    638
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    145
    Digital Goods:
    1
    #5
    Thank you that what i wanted to know
     
    shuman202, Jul 24, 2013 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #6
    That there are still major commercial scripts with new versions released THIS YEAR that still use the mysql_ functions pisses me off no end. We've been told for EIGHT YEARS to stop using it, but much like the folks who still sleaze out HTML 4 tranny (who seem to be the only ones dumb enough to embrace 5) most developers can't seem to pull their heads out of a decade ago's backside. Guess they've been shoving it up the 1990's arse for so long we better call a orthodontist to help.

    When six drops and obsoletes / removes it entirely everyone's gonna run around like chickens with their heads cut off, and we'll have that same stupid malfing "let's run two versions side by side at once" we had with 4/5. Pathetic when they'll have had over a decade to prepare for it. It ends up being a bit like Ike's assessment of pre-war America.

    "Urgent directives from above and protest from the occasional "Alarmist" could not eliminate an apathy that had its roots in comfort, blindness and wishful thinking." -- Dwight D. Eisenhower "Crusade in Europe"
     
    deathshadow, Jul 25, 2013 IP
    liamwli likes this.
  7. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #7
    If you want to upgrade to a PHP version that has removed (and not just deprecated) mysql_* methods you have two choices:

    * If your codebase is small, or have centralized object that handles DB methods, consider switching to PDO or MySQLi.
    * If your codebase is big or will involve too much risk to make too much code change at one point (example a site with little or no unit testing), consider using a PDO wrapper @ http://www.phpclasses.org/package/8221-PHP-Access-MySQL-databases-using-PDO-wrapper-functions.html. It is fairly new, but I will be updating it if I become aware of any issues with it.
     
    ThePHPMaster, Sep 8, 2013 IP
  8. EmmanuelFlossie

    EmmanuelFlossie Active Member

    Messages:
    159
    Likes Received:
    11
    Best Answers:
    2
    Trophy Points:
    65
    #8
    It was actually only this year that i have upgraded all my ecommerce sites with mysqli. It just takes time :)
    Of course not 8 years :p
     
    EmmanuelFlossie, Sep 8, 2013 IP