1. virtual pet mascot

    Virtual Pets

    Welcome to the Virtual Pet list forum!
    We're a virtual pets and sim games community and the largest forum in our industry. Game owners can use our forum to their advatange by promoting/advertising their games to our users and receive feedback/reviews from those members that try their games out. We support developers of all kinds from RPG developers, sim game developers to virtual pet site developers. We want to see more games in our industry come across more success and that's why we try our best to release as many guides/articles regarding online gaming development as we can.
    We're unlike other forums in our industry because we try our best to be there for our users no matter what and give them advice whenever they ask for it. Running an online game isn't an easy task, but with our many resources that we've built since 2011, you'll learn a lot from our online community. Please don't ever be afraid to ask a question on the forums because if you never ask, then you'll never receive an answer to your question and you can only improve by asking other users for help/advice.
    We have a lot of virtual pet sites' owners and sim game owners that are very frequent visitors on our online community. Along with artists, writers and programmers that come here looking for work and games to work for. Our members who are artists sell art in our art marketplace and programmers are allowed to sell their scripts in the programming marketplace. We also allow game owners to sell their game in our general marketplace
    In early 2011, we decided to make a comeback to the internet because in 2010, we had a minor setback and we had to re-launch without any content, but with a lot of time, patience, hardwork and effort, we've managed to rebuild the Virtual pet list community into something better than it was before. We actually registered our domain name on November 4th, 2004, but we were only a directory then and all we had was a basic comments system for users to post things on their favorite games..
    So, what are you waiting for, why don't you join today? If you have any problems figuring out our security code, then here's a hint, it has millions upon users and has been around since 1997.
    Our list of virtual pet sites and directory of sim games have a lot of different games listed, so we're pretty sure that you may find some games that suits your needs as a player of sim games or virtual pet sites.
    If you're still curious about a certain game that you'd like to play, then please check out some of our game reviews that were written by some of our great contributors and our interviews with respective virtual pet site owners, sim game owners, artists, writers and programmers that have worked in this industry.

  2. Guest,


    Over the next few days there may be some slight changes to VPL. If you see something going on don't be alarmed we most likely know about it! If you have any troubles please contact Evolution.

    Happy Holidays
    The VPL Staff
  3. Check out our latest guide on how to grow your user base!
    Paladore - Boopets - Icepets - Corepets open beta
    Virtual Pet Directory
    Are you looking for new virtual pet sites or sim games to play?
    VPL's sister site the virtual pets blog

MySQL() Function Deprecation in PHP 5.4

Discussion in 'Programming General' started by nobackseat, Aug 30, 2011.

  1. nobackseat

    nobackseat Superb Member VPL Member

    Reputations:
    0
    Joined:
    Jan 22, 2011
    Messages:
    508
    Likes Received:
    46
    Trophy Points:
    0
    Location:
    Florida
    So this is some big news, PHP will be deprecating all mysql() functions in PHP starting at version 5.4. Although this is only a 'soft' deprecation, it should still say a lot about what you should be using to power the database communication.

    Some good alternatives are PDO and MySQLi. PDO is great, and using Juddster's database class makes it easy to implement.

    It will probably be yearssssssssssssss before hosts generally began to adopt 5.4 into their shared hosting, but still, 5.4 is already in alpha releases, so move fast to stay modern!

    (Using a PHP framework, I have nothing to worry about. :))

    If you don't know if your site uses mysql(), then it probably does, as it is the most common way to communicate with the database.

    This release will also completely remove register_globals, make short tags work regardless of configuration, FastCGI Process Manager is officially added, new syntax for arrays, built-in HTTP server, show progress of uploads, and E_ALL really shows all errors. :D

    I'm not sure yet if they're having APC come included. Anybody know?

    I know if I had a site, I'd already be testing it on it. There are lots of performance improvements.

    What do you guys think of this?

    NBS
     
    Last edited: Aug 30, 2011
    Earth likes this.
  2. GGitzOle

    GGitzOle Guest

    Reputations:
    0
    Why are they getting rid of the mysql() function(s)?
     
  3. Andy

    Andy Growing Member VPL Member

    Reputations:
    0
    Joined:
    Feb 23, 2011
    Messages:
    70
    Likes Received:
    15
    Trophy Points:
    0
    They're old functions, they promote insecure programming and they lack modern features.

    You're expected to use the mysqli library or pdo instead of the mysql functions now. But they're not being 'removed' really, just deprecated. You'll get a notice (or warning?) when you use those functions, but they'll still work as they did before.
     
  4. GGitzOle

    GGitzOle Guest

    Reputations:
    0
    hmm what modern features do they lack?
     
  5. Andy

    Andy Growing Member VPL Member

    Reputations:
    0
    Joined:
    Feb 23, 2011
    Messages:
    70
    Likes Received:
    15
    Trophy Points:
    0
    Prepared statements, multiple statements, transactions, cursors, stored procedures, oop interface, and more.
     
  6. Excel

    Excel Growing Member VPL Member

    Reputations:
    -5
    Joined:
    Feb 25, 2011
    Messages:
    59
    Likes Received:
    4
    Trophy Points:
    0
    Location:
    California, USA
    Pretty much everything haha. I think the main thing is that they force you to sanitize for SQL injection, where as pretty much any other method of connecting with the database does most of that for you.

    mysqli and pdo allow for prepared statements...
    Technically, it doesn't protect from sql injections any better than the old mysql module, just makes doing it easier for the developer, who can now use prepared statements instead of calling mysql_real_escape_string.

    And then there's all the things Andy listed. mysql_XXX is soo 1990s :p
     
  7. BigThinker

    BigThinker Supporter VPL Supporter

    Reputations:
    2
    Joined:
    May 9, 2011
    Messages:
    938
    Likes Received:
    43
    Trophy Points:
    0
    As a beginner just learning how to code, should I learn how to code with the oldschool way of doing MySQL and then learn the new one or just skip the old one? is there a tutorial out there for it?
     
  8. indysolo621

    indysolo621 Elite Member VPL Member

    Reputations:
    0
    Joined:
    Feb 27, 2011
    Messages:
    1,397
    Likes Received:
    59
    Trophy Points:
    0
    I would suggest not learning mysql. No reason to spend time learning it if it is just going to be deprecated. Learn PDO or mysqli. (Should be easy to go back and learn mysql once you learn these ;) )
     
    Last edited: Sep 7, 2011
  9. nobackseat

    nobackseat Superb Member VPL Member

    Reputations:
    0
    Joined:
    Jan 22, 2011
    Messages:
    508
    Likes Received:
    46
    Trophy Points:
    0
    Location:
    Florida
    Hi @BigThinkerBigThinker,

    I definitely suggest you learn mysql_*() functions. As a programmer, it really does benefit to have a broad skill set and be flexible. Since it is the most common method, I suggest you learn it as a good foundation, and then build upon it to the more advanced techniques.

    Good luck.

    NBS
     
    Last edited by a moderator: Oct 16, 2013
  10. BigThinker

    BigThinker Supporter VPL Supporter

    Reputations:
    2
    Joined:
    May 9, 2011
    Messages:
    938
    Likes Received:
    43
    Trophy Points:
    0
    Alright.. I'll take a gander at both. I'm learning about arrays and stuff now so I am still quite a ways away from databases. :)
     
  11. righteousfail

    righteousfail Pet Game Owner Pet Game Owner VPL Member

    Reputations:
    4
    Joined:
    Nov 22, 2011
    Messages:
    89
    Likes Received:
    6
    Trophy Points:
    0
  12. myrianna

    myrianna Approved Artist Pet Game Owner Approved VPL Artist VPL Member

    Reputations:
    0
    Joined:
    Apr 24, 2011
    Messages:
    456
    Likes Received:
    35
    Trophy Points:
    0
    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
     
  13. judda

    judda Bringer of Awesome Moderator Pet Game Owner Programming Moderator

    Reputations:
    20
    Joined:
    Jan 23, 2011
    Messages:
    1,549
    Likes Received:
    423
    Trophy Points:
    0
    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
     
  14. Hituro

    Hituro Supporter VPL Supporter Pet Game Owner VPL Member

    Reputations:
    19
    Joined:
    Feb 1, 2011
    Messages:
    1,422
    Likes Received:
    98
    Trophy Points:
    0
  15. SpotOnTech

    SpotOnTech Newish Member VPL Member

    Reputations:
    0
    Joined:
    Jun 21, 2012
    Messages:
    15
    Likes Received:
    2
    Trophy Points:
    0
    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.
     
  16. Avalanche

    Avalanche Supporter VPL Supporter

    Reputations:
    0
    Joined:
    May 30, 2011
    Messages:
    428
    Likes Received:
    82
    Trophy Points:
    0
    Location:
    USA
    Thankfully, SQL stays pretty much the same. It's just the names of the functions you really have to worry about.
     
  17. judda

    judda Bringer of Awesome Moderator Pet Game Owner Programming Moderator

    Reputations:
    20
    Joined:
    Jan 23, 2011
    Messages:
    1,549
    Likes Received:
    423
    Trophy Points:
    0
    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
     
    nobackseat likes this.
  18. SpotOnTech

    SpotOnTech Newish Member VPL Member

    Reputations:
    0
    Joined:
    Jun 21, 2012
    Messages:
    15
    Likes Received:
    2
    Trophy Points:
    0
    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.
     
  19. judda

    judda Bringer of Awesome Moderator Pet Game Owner Programming Moderator

    Reputations:
    20
    Joined:
    Jan 23, 2011
    Messages:
    1,549
    Likes Received:
    423
    Trophy Points:
    0
    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
     
  20. SpotOnTech

    SpotOnTech Newish Member VPL Member

    Reputations:
    0
    Joined:
    Jun 21, 2012
    Messages:
    15
    Likes Received:
    2
    Trophy Points:
    0

Share This Page