我需要获取结果行数
$this-> db = new mysqli("localhost", "***", "***", "***") or die("Error ".mysqli_error($link));
$this-> db -> set_charset("utf8");
$query = "SELECT steps.id, steps.description, steps.sort, services.`name` AS service_name, services.short_name AS service_short_name, terminals.`name` AS terminal_name, terminals.short_name AS terminal_short_name FROM steps INNER JOIN instructions ON steps.page_id = instructions.id INNER JOIN services ON instructions.service_id = services.id INNER JOIN terminals ON instructions.terminal_id = terminals.id WHERE services.short_name = '{$service}' AND terminals.`name` = '{$terminal}' ORDER BY steps.sort";
if ($stmt = $this->db-> prepare($query)) {
$stmt -> execute();
$stmt -> store_result();
printf("row count: %d.\n", $stmt -> num_rows);
$stmt -> close();
}
它返回零 - 0但有一些像 10-15 行