Skip to main content

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>

Comments

Popular posts from this blog

PHP#33MySQL#29 - Đếm lượt truy cập (KẾT THÚC KHÓA HỌC)

//hitcounter.php <?php session_start();  ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php  include("../connect.php"); //cập nhật số luowhtj truy cập: $sl="update counter set cnt=cnt+1"; mysqli_query($link,$sl); //Lấy dữ liệu số lượt truy cập để hiển thị ra web: $sl2="select * from counter"; $kq=mysqli_query($link,$sl2); $d=mysqli_fetch_array($kq); //Định dạng: $chuoi=str_pad($d['cnt'],6,"0",STR_PAD_LEFT); $luottrycap=""; for($i=0;$i<strlen($chuoi);$i++) { $tam=substr($chuoi,$i,1); $luottrycap.="<img src='images/$tam.png'/>"; } /*-Khi user truy cập vào website: +lần đầu tuy cập: Lưu thông tin của user lên csdl +Sau lần đầu tiên: cập nhtaaj lastvisit - Xóa các dòng dữ liệu quá 1 phút (Quy ước thời gian để khẳng định online hay offline: 1 phút) - Thống kê số liệu người dùng o...

2 (giao diện Visual C#) Solution Explorer

Bài 2 - SOME OTHER TIME - Vào dịp khác