I’m fairly new to PHP and have built a medium sized website using standard MySQL database calls. However, I have recently learned about PDO and I am hoping to find out from the community if it is worth switching from MySQL over to PDO. For security I have been using mysql_real_escape_string.
Info about the site:
I’m using a mix of INSERT and SELECT calls. The data returned from SELECT calls isn’t massive (no more than 30 records returned by using LIMIT). There will also not be a whole lot of INSERTs. The site is currently not live and so making changes now is easy.
In your professional opinions, is it worth my time to switch the site over to PDO from MySQL? Or is staying with MySQL just as good? Or in other words, what would be the reason, if any, to switch to PDO now?
PDO has the following advantages over the mysql_* functions:
This question has been asked before, you may want to take a look at the answers:
If you are starting a new project, I would strictly suggest using PDO or a higher-level library/ORM. If you already have a lot of code written without it, it may not be worth it.