Posted By: Anonymous
I was suggested, not long ago, to change my code to use PDO in order to parameterize my queries and safely save HTML in the database.
Well, here are the main problems:
I looked at http://php.net/manual/en/ref.pdo-mysql.php, and I don’t really get where I should put that
$ ./configure --with-pdo-mysqlstring…
The site I’m building actually only requires PDO for one page. While I may consider re-writing it, it would take a while and I need the pages to be running soon, so I can’t turn off MySQL completely. If I do install PDO, will I still be able to use
The server in question is running PHP Version 5.4.6-1ubuntu1 and Apache/2.2.22 (Ubuntu). I’m also running a phpMyAdmin database, if it matters.
On Ubuntu you should be able to install the necessary PDO parts from apt using
sudo apt-get install php5-mysql
There is no limitation between using PDO and mysql_ simultaneously. You will however need to create two connections to your DB, one with mysql_ and one using PDO.