interface btQuaternion {
void btQuaternion(float x, float y, float z, float w);
void setValue(float x, float y, float z, float w);
void setEulerZYX(float yaw, float pitch, float roll);
};
btQuaternion implements btQuadWord;
返回:
$rowCount = $conn->query('SELECT COUNT(*) FROM Users');
echo '<pre>'.print_r($rowCount,1).'</pre>';
...虽然我在PHPMyAdmin中看到了 978 行。
答案 0 :(得分:7)
您正在使用print_r生成查询中的行数。您的查询只返回一行,即行数。
试试这个:
$rowCount = $conn->query('SELECT COUNT(*) as rowNumber FROM Users');
$row = $rowCount->fetch_assoc();
echo $row['rowNumber'];
答案 1 :(得分:-1)
查询返回一个对象,您需要从该对象中获取结果
$sql = "SELECT COUNT(*) AS count FROM Users";
if ($res = $mysqli->query($sql)) {
/* Fetch object array */
while ($obj = $res->fetch_object()) {
echo '<pre>'.print_r($obj->count,1).'</pre>';
}
$res->close();
}