Home > Article > Backend Development > PDO query mysql database_PHP tutorial
PDO query mysql database This article provides an example tutorial of php pdo mysql operation. This is to query mysql data and display it by php pdo
pdo query mysql tutorial database tutorial
This article provides a php tutorial pdo mysql operation example tutorial, which is to query mysql data and display it by php pdo
*/
try {
$dbh = new pdo($beidou_connstr,$beidou_user,$beidou_pass);
foreach ($dbh->query('select count(*) as count1, count(*) as count2 from bd_reve.user_day') as $row) {
print_r($row);
}
$dbh = null;
} catch (pdoexception $e) {
Print "error!: " . $e->getmessage() . "
";
Die();
}