mysqli_num_rows($result);和$result->num_rows;
的区别呢?
的区别呢?
2018-05-21
//遍历文章列表
if(!empty($data)){
foreach($data as $value){
//show every article
}
}
if(!empty($data)){
foreach($data as $value){
//show every article
}
}
2018-04-23
//取得所有文章的列表
$s = "select * from article order by dateline desc";
$r = mysqli_query($con, $s);
if(!$r && mysqli_num_rows($r)){
while($row = mysqli_fetch_assoc($r)){
$date[] = $row;
}
}
else{
$date = array();
}
$s = "select * from article order by dateline desc";
$r = mysqli_query($con, $s);
if(!$r && mysqli_num_rows($r)){
while($row = mysqli_fetch_assoc($r)){
$date[] = $row;
}
}
else{
$date = array();
}
2018-04-23
$con = mysqli_connect(HOST, USERNAME, PASSWORD) or die('connect failed');
mysqli_select_db('info');
mysqli_query($con, 'set name utf8');
mysqli_select_db('info');
mysqli_query($con, 'set name utf8');
2018-04-23