Skip to main content

Posts

Showing posts from December 21, 2021

PHP#11MySQL#7 - Phân Trang (rất quan trọng)

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.php : Bài tập 1 <!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"); //Quy ước 1 trang gồm 5sp: $sp=5; //Truy vấn lấy tất cả sản phẩm: $sl="select TenSP, UrlHinh, Gia from webtm_sanpham"; $kq=mysqli_query($l...