一聚教程网:一个值得你收藏的教程网站

热门教程

PDO 查询mysql数据库

时间:2022-06-24 19:08:33 编辑:袖梨 来源:一聚教程网

 代码如下 复制代码
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();
}

热门栏目