Home  >  Article  >  Backend Development  >  PDO query mysql database_PHP tutorial

PDO query mysql database_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:04:55944browse

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();
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630815.htmlTechArticlePDO query mysql database This article provides an example tutorial of php pdo mysql operation, which is php pdo query mysql data and display pdo query mysql tutorial database tutorial this article provides a...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn