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