qq_初夏风_0
2017-03-08 23:37
<?php
$page= $_GET['P'];
$host = "qdm165278190.my3w.com";
$username = "qdm165278190";
$password = "liyigang889897";
$db="qdm165278190_db";
$conn = mysqli_connect($host,$username,$password);
if(!$conn){
echo "数据库连接失败";
exit;
}
mysqli_select_db($db);
mysqli_query ("SET NAMES UTF8");
$sql = "select * from tdb_goods limit " .($page-1)*10 . ",10";
$result = mysqli_query($sql);
while($row = mysql_fetch_assoc($result)){
echo $row['goods_name'].'_'.$row['goods_cate'].'<br>';
}
mysqli不是这样用的,
$conn = new mysqli($host,$username,$password,$db);
$result = $conn -> query($sql);
用面向对象的方式写
PHP+MySQL分页原理实现
41180 学习 · 175 问题
相似问题