php code to test pdo is available?

PDO is always installed for php 5.1+. You can check for specific db drivers that are installed or not using phpinfo(); You could try to check for specific drivers using @Mark Baker idea and checking for specific constants; var_dump(defined(PDO::MYSQL_ATTR_LOCAL_INFILE)); // mysql var_dump(PDO::FB_ATTR_TIME_FORMAT)); // firebird Note that not all drivers have specific constants defined so phpinfo() … Read more

How do I loop through a MySQL query via PDO in PHP?

Here is an example for using PDO to connect to a DB, to tell it to throw Exceptions instead of php errors (will help with your debugging), and using parameterised statements instead of substituting dynamic values into the query yourself (highly recommended): // connect to PDO $pdo = new PDO(“mysql:host=localhost;dbname=test”, “user”, “password”); // the following … Read more

PHP PDO and MySQLi [duplicate]

At the basic level the mysql, mysqli and PDO extensions all answer the question how do I talk to the database? They all provide functions and functionality to connect to a database and send and retrieve data from it. You can use them all at the same time establishing several connections to the database at … Read more