查询
$pdo=new PDO('mysql:host=localhost;dbname=test','root','root');
$pdo->exec('set names utf8');
$sql="select * from user";
$smt=$pdo->query($sql);
$rows=$smt->fetchAll(PDO::FETCH__ASSOC);
print_r($rows);
删除
$id=$_GET['id'];
$pdo=new PDO('mysql:host=localhost;dbname=test','root','root');
$pdo->exec('set names utf8');
$sql="delete from user where id={$id}";
if($pdo->exec($sql)){
echo 1;
}