Tra Từ Điển

Thời gianTiếtThứ 2Thứ 3Thứ 4Thứ 5Thứ 6
8g40 - 9g101Tiếng Việt
Tiếng Anh
Tiếng Việt
Tiếng Việt
9g10 - 9g302Nghỉ giải lao
Tiếng Anh
Nghỉ giải lao
Nghỉ giải lao
9g30 - 10g3Toán
Toán
Toán

Saturday, December 11, 2021

PHP#7 - MySQL#3 - Hiện thông tin ( $sl="select idUser, HoTen, Username, Email from user"; ) LÊN BẢNG


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<?php
$link=@mysqli_connect("localhost","root","") or die;
mysqli_select_db($link,"webtintuc") or die;
$sl="select idUser, HoTen, Username, Email from user";
$kq=mysqli_query($link,$sl);
?>
<table width="500" border="1">
<tbody>
<tr>
<th width="64" scope="col">idUser</th>
<th width="159" scope="col">HoTen</th>
<th width="135" scope="col">Username</th>
<th width="132" scope="col">Email</th>
</tr>
<?php
while($d=mysqli_fetch_array($kq))
{
?>
<tr>
<td><?php echo $d['idUser'];?></td>
<td><?php echo $d['HoTen'];?></td>
<td><?php echo $d['Username'];?></td>
<td><?php echo $d['Email'];?></td>
</tr>
<?php } ?>
</tbody>
</table>
<body>
</body>
</html>

0 comments:

Post a Comment