一对一 多对多

$list = mysqli_connect('localhost','root','root');

mysqli_select_db($list,'yi_duo');

mysqli_query($list,'set names utf8');

$ser = 'select * from yi_yi inner join yi_er where yi_yi.info_id=yi_er.id';

$res= mysqli_query($list,$ser);

$ass = mysqli_fetch_assoc($res);

 

 

 

 


$ser = 'SELECT
ymt_ming.xing,ymt_jiaoshi.laoshi,ymt_chor.username
FROM
ymt_ming
INNER JOIN
ymt_jiaoshi
ON
ymt_ming.jiaoshi_id=ymt_jiaoshi.id
INNER JOIN
ymt_chor
ON
ymt_ming.chor_id=ymt_chor.id
';

$res= mysqli_query($list,$ser);

while($ass = mysqli_fetch_assoc($res)){

print_r($ass);
echo "<br>";
}

上一篇:DRF——分页器


下一篇:【Codeforces 1106B】Lunar New Year and Food Ordering