1
<?php
header("Content-Type:text/html;charset=utf-8");
include 'conn.php';

$sql = 'select count(*) as c from mytable';
$res = mysqli_query($db_link,$sql);

echo mysqli_result($res,0) ;  //mysqli里没有和mysql_result()相对应的函数,因此自定义一个

function mysqli_result($res,$n){    
    $arr = mysqli_fetch_array($res);    
    return $arr[$n]; 
}

?>

风干的果子
6 声望1 粉丝