Connection to database:
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass,
array(PDO::ATTR_PERSISTENT => true));
Preparation of statement:
$stmt = $db->prepare('SELECT * FROM foo',
array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
Is the statement SELECT * FROM foo
only prepared once and then stored on the MySQL server for all subsequent invocations of the PHP script? Or is it re-prepared every time the PHP script is called?