printf
似乎没有工作,没有收到错误
require_once('settings.php');
$link = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if(!$link)
{
die("Error " . mysqli_connect_error());
}
$query = "SELECT * FROM 'testarea'";
if($result = mysqli_query($link, $query)){
printf($result->num_rows); // Trying to get back number of rows
};
mysqli_close($link);
答案 0 :(得分:0)
只需从表名
中删除单引号即可 $query = "SELECT * FROM testarea";