Wednesday, 15 December 2021

in HoTenCS từ database ra màn hình - Tiếp theo in thêm TenBH dưới HoTenCS

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Ca sĩ Duc</title>
  </head>
  <body>
    <?php
		$link=@mysqli_connect("localhost","root","") or die("Không tìm thấy Sever");
		mysqli_select_db($link,"webtintuc") or die("Không tìm thấy DB");
		mysqli_query($link, "set names 'utf8'");
		$sl="select * from webnhac_casi";
		$kq=mysqli_query($link,$sl);
	?>
    <ul>
      <?php
		while($d=mysqli_fetch_array($kq))
		{
		?>
      <li><?php echo $d['HoTenCS']; 
	  		$slbh="select idBH, TenBH from webnhac_baihat where idCS=".$d['idCS'];
			$kqbh=mysqli_query($link,$slbh);
	  		?>
      	<ul>
        <?php
        	while($dbh=mysqli_fetch_array($kqbh)){
		?>
        	<li><?php echo $dbh['TenBH']; ?></li>
            <?php } ?>
        </ul>
      </li>
      <?php } ?>
    </ul>
  </body>
</html>

0 comments:

Post a Comment