$pdo=new PDO(连接数据库); $pdo->exec('set names utf8'); //设置字符集 $sql="select * from C表 as c left join A表 as a on c.uid=a.uid where uid=2"; $data=$pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);//得到数据 //下面就只写关键步骤了?>>a>b>c>d