标签:
$viewPages = 0;
$db = new mysqli(‘localhost‘,$MYSQL_USER,$MYSQL_PASS,$MYSQL_DB);
if (!mysqli_connect_errno()){
$sql = "call proc_getrelativeviewids(‘201605101715444261‘)";
$result = $db->query($sql);
if($result) {
if($row= $result->fetch_assoc()){
$count = $row[‘cnt‘];
}
if (!empty($count))
$viewPages = ceil($count/PAGE_SIZE);
var_dump($viewPages);
$result->close();
$db->next_result();
$sql = "call proc_getrelativeviewids(‘201605101715444261‘)";
$result = $db->query($sql);
}
if($result) {
if($row= $result->fetch_assoc()){
$count = $row[‘cnt‘];
}
if (!empty($count))
$viewPages = ceil($count/PAGE_SIZE);
var_dump($viewPages);
$result->close();
$db->next_result();
}
}
$db->close();
标签: