Ask HN: Accessing databases with PHP?
What's is the preferred method for connecting with a database in PHP in 2014? I realize things move fast in the tech industry and there are always new updates and fixes happening but when building a websites in our era which is the best way to do.
Mysql, Mysqli or PDO?
MySQL is deprecated and outright removed in PHP 5.5, so MySQLi is your fallback option instead. However, PDO is the best choice.
Were I to choose one for a new project now, I would probably go with PDO simply because of its generic nature and support for prepared queries with parameter replacement. Mysqli apparently has this too but bind variables are somewhat difficult to use with the mysqli extension.