Follow us on...
Follow us on Twitter Follow us on Facebook
Register

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Junior Member
    Join Date
    22 Nov 2011
    Posts
    79
    Threads
    3
    Blog Entries
    2

    My User Ranks

    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    I was kind of worried at first thinking about transitioning, but when I looked into what Mysqli was actually about I realized the actual changes to the query code would be relatively small:

    http://www.php.net/manual/en/mysqli....-interface.php
    My virtual pet site!
    http://www.mystikpets.com/

  2. #12
    Approved Game Owner
    Join Date
    24 Apr 2011
    Posts
    402
    Threads
    22
    Blog Entries
    3

    My User Ranks



    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    I might as well go through it now... not that hard or time consuming with find+replace xd. Just got to remember to do it this way with future stuff

  3. #13
    Approved Programmer
    Join Date
    23 Jan 2011
    Posts
    752
    Threads
    34
    Blog Entries
    2

    My User Ranks




    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    This is where abstracting away the actual database object helps a fair bit. If you had abstracted it, then this change would be in 1 file instead of trickled through multiple.

    ~judda
    Personal Site, Blog, Development Projects all wrapped up into one convenient location. Click here to begin. I am very straight to the point ... if you don't like it ...just feel free to ignore me.

    Blog :: Development Blog :: Resume




    Virtual Pet News - Aggregator of all pet site News Feeds
    SQL Blog Feed - Aggregator of several SQL blog sites
    PHP Blog Feed - Aggregator of several PHP blog sites

  4. #14
    VPL Supporter Hituro's Avatar
    Join Date
    01 Feb 2011
    Posts
    1,293
    Threads
    220

    My User Ranks


    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    Looks like they are only deprecating mysql_list_dbs() at this point in 5.4.x

    http://docs.php.net/manual/en/migrat...deprecated.php

  5. #15
    Newbie
    Join Date
    21 Jun 2012
    Posts
    15
    Threads
    1

    My User Ranks

    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    Working on a few sites lately I've ran into multiple $_GET and $_POST that are in free air and not escaped in any way, shape or form. I think it would have been nice if the mysql() functions would have thrown an automatic fatal error if they're not escaped. I think PDO will be nice, but it's sure hard when you have a site that's fully coded using all mysql and there is no function library or master includes in place.

  6. #16
    VPL Supporter Avalanche's Avatar
    Join Date
    30 May 2011
    Location
    USA
    Posts
    428
    Threads
    20
    Blog Entries
    3

    My User Ranks


    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    Thankfully, SQL stays pretty much the same. It's just the names of the functions you really have to worry about.

  7. #17
    Approved Programmer
    Join Date
    23 Jan 2011
    Posts
    752
    Threads
    34
    Blog Entries
    2

    My User Ranks




    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    Quote Originally Posted by SpotOnTech View Post
    Working on a few sites lately I've ran into multiple $_GET and $_POST that are in free air and not escaped in any way, shape or form. I think it would have been nice if the mysql() functions would have thrown an automatic fatal error if they're not escaped. I think PDO will be nice, but it's sure hard when you have a site that's fully coded using all mysql and there is no function library or master includes in place.
    You do realize that that is not physically possible for these functions to do this. How do they know that you are not trying to "DELETE FROM users WHERE userid = '1' OR 1=1--"? How is the function to know that? Yes, you can because you are able to look at the context of the code and make an informed decision however, the database is just doing exactly what it is being told.

    TBH, people should never include the user's input directly into a query. They should be using query parameters. This avoid the need to escape the strings all together.

    ~judda
    Personal Site, Blog, Development Projects all wrapped up into one convenient location. Click here to begin. I am very straight to the point ... if you don't like it ...just feel free to ignore me.

    Blog :: Development Blog :: Resume




    Virtual Pet News - Aggregator of all pet site News Feeds
    SQL Blog Feed - Aggregator of several SQL blog sites
    PHP Blog Feed - Aggregator of several PHP blog sites

  8. #18
    Newbie
    Join Date
    21 Jun 2012
    Posts
    15
    Threads
    1

    My User Ranks

    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    Quote Originally Posted by judda View Post
    You do realize that that is not physically possible for these functions to do this. How do they know that you are not trying to "DELETE FROM users WHERE userid = '1' OR 1=1--"? How is the function to know that? Yes, you can because you are able to look at the context of the code and make an informed decision however, the database is just doing exactly what it is being told.

    TBH, people should never include the user's input directly into a query. They should be using query parameters. This avoid the need to escape the strings all together.

    ~judda
    The Zend engine can already parse out bad data (mysql_real_escape_string anyone?). Why can't mysql() do it anyway? If a user is trying to DELETE * FROM dbtable then they deserve to have bad things happen. That's what DROP is for.

  9. #19
    Approved Programmer
    Join Date
    23 Jan 2011
    Posts
    752
    Threads
    34
    Blog Entries
    2

    My User Ranks




    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    Quote Originally Posted by SpotOnTech View Post
    The Zend engine can already parse out bad data (mysql_real_escape_string anyone?). Why can't mysql() do it anyway? If a user is trying to DELETE * FROM dbtable then they deserve to have bad things happen. That's what DROP is for.
    DROP is for dropping tables ... not emptying them. They are two completely different things.

    What functions / objects in the Zend framework do you use for that. I would like to read up on it (because I don't believe it works that way).

    ~judda
    Personal Site, Blog, Development Projects all wrapped up into one convenient location. Click here to begin. I am very straight to the point ... if you don't like it ...just feel free to ignore me.

    Blog :: Development Blog :: Resume




    Virtual Pet News - Aggregator of all pet site News Feeds
    SQL Blog Feed - Aggregator of several SQL blog sites
    PHP Blog Feed - Aggregator of several PHP blog sites

  10. #20
    Newbie
    Join Date
    21 Jun 2012
    Posts
    15
    Threads
    1

    My User Ranks

    My Reputation

    Re: MySQL() Function Deprecation in PHP 5.4

    Zend's framework info: http://www.ibm.com/developerworks/op.../os-php-zend1/

    Also, a good article on mysql_real_escape_string vs. addslashes: http://shiflett.org/blog/2006/jan/ad...-escape-string

 

 

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
  •