7

So php7 deprecated all support for mysql none of my previous projects are working on localhost.Moreover,Ubuntu removed the php5 package from it's latest version . FML.

Comments
  • 0
    use mysqli_ or downgrade if you must
  • 0
    why the mysql hate?
  • 3
    mysql is so old and not secure use mysqli_ or PDO is you want more security
  • 0
    so apparently you have to downgrade to older PHP on server. i faced the same issue.
  • 1
    If you still use mysql it's time to change to pdo or mysqli... :)

    Also if mysqli, don't forget to use real_escape_string.. :)
  • 0
    update the code to PDO of you can, there are many security issues with plain MySQL. Or just set up and old version of Ubuntu to get them running, but you should definitely start using PDO on new project's :)
  • 2
    Whoa... IDK why you are worried tho... You can update the relevant parts and viola. Also the API was deprecated from 5.4 (5.3?) plenty of time to migrate to the mysqli_*, this one on you 😕
  • 0
    @lotd if you use bind param in mysqli their is no need to use real_escape_string
  • 1
    just add mysql functions back into php7. no idea why would would use that over mysqli. object oriented is much cleaner code. but anyway, here is an article showing how to add it back https://ckon.wordpress.com/2015/08/...
  • 1
    Who still uses the original mysql_* package :-/
    It's horribly unsecure and been deprecated for years...
  • 0
    there is a huge codebase at my work that runs on PHP 5.x, uses mysql_ everywhere. It was code bought from some Indian company.

    Rewriting all of it to use mysqli would be quite a huge chunk of work, and not something my boss would see as "worth it" :)
  • 0
    @AdamGaskins a lot of mysql_ methods can be rewritten 1-to-1 with thier mysqli_ counterpart though you lose the advantages of prepared statements.
  • 2
    @nuts Some of us are stuck with a codebase that still uses the mysql_* methods. Some of us can't just make the decision to do the task of rewriting the code to use mysqli or PDO. We have bosses that make those decisions, and unfortunately, "just getting things done" is more important to them.
  • 0
    But this post is nonsense... he complains that the default version of php is 7.0 in Ubuntu 16.04... that was a right decision by Canonical, the world goes forward, if he wants php5 he can just add a ppa
  • 0
    @burswag Then you talk to them so they understand the importance of maintaining code.
  • 0
    @nblackburn do you have a job? if so it must be a very nice one :)
Add Comment