Skip to main content

Posts

Showing posts from December 22, 2021

(Phân trang) Liên kết trang $_GET, hiện dữ liệu và phân trang tại trang khác WHERE , LIMIT

Database : https://drive.google.com/file/d/16mUt4iNR-FOraT1NAjtpXkPJVh3tPaiY/view Hình ảnh : https://drive.google.com/file/d/19hJroj8BNEVV4_osAo2eXHspMciJb6LA/view //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'"); ?> // loaisp_duc.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>loaisp_duc</title> </head> <body> <?php include("connect.php"); $sl="select * from webtm_loaisp"; $kq=mysqli_query($link,$sl); while($d=mysqli_fetch_array($kq)) { echo "<p><a href='pt_loai_duc.php? idLoai={$d['idLoai']} '>{$d['TenLoai']}</a></p>...

(Phân trang) cần đếm Tổngsốsảnphẩm, Tổngsốtrang, truyền tham số Trang, tính Vịtrí (dựa vào tham số Trang) $vt=($p-1)*$sp

Database : https://drive.google.com/file/d/16mUt4iNR-FOraT1NAjtpXkPJVh3tPaiY/view Hình ảnh : https://drive.google.com/file/d/19hJroj8BNEVV4_osAo2eXHspMciJb6LA/view //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'"); ?> //phantrang_duc.php?p="sốtrang" <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style> .ht{font-size: 20px; color: #F10C0F; font-weight: bold;} </style> </head> <body> <?php include("connect.php"); $sp=5; echo "Sản phẩm mỗi trang: ".$sp; $sl="select TenSP, UrlHinh, Gia from webtm_sanpham"; $kq=mysqli_query($...