<?php /** pdo的使用 **/ try { $dbh = new PDO('mysql:host=localhost;dbname=wc','root','root'); foreach($dbh->query('SELECT * from ss') as $row) { echo '<br/>'; print_r($row); $arr[]=$row; } var_dump($arr); $dbh = null; } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } ?>