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

Tuesday, December 14, 2021

lienket.php - chèn thuộc tính Url vào Ten từ database & in lên Bảng

 <!doctype html>

<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<?php
include("connect.php");

$sl="select Ten, Url from lienket order by ThuTu ASC";
$kq=mysqli_query($link,$sl);
?>
<table width="100" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th scope="col">Các liên kết</th>
</tr>
<?php
while($d=mysqli_fetch_array($kq))
{
?>
<tr>
<td><a href="<?php echo $d['Url'];?>"><?php echo $d['Ten'];?></a></td>
</tr>
<?php }?>
</tbody>
</table>
</body>
</html>


//connect.php

 <?php

//Kết nối đến server DB:
$link=@mysqli_connect("localhost","root","") or die("Không thể kết nối đến Server!");
//Chọn database cần thao tác:
mysqli_select_db($link,"webtintuc") or die("Không tồn tại DB này!");
mysqli_query($link,"set names 'utf8'");
?>

0 comments:

Post a Comment