I'm trying to count the number of rows based on a WHERE
in php but when I execute it it throws me an error.
Code to count
public function mostrarRollosModel($tabla){
$stmt = Conexion::conectar() -> prepare("SELECT cod_parte FROM $tabla WHERE es_rollo='S'");
$stmt->execute();
$stmt -> fetchAll();
$numero_filas = mysqli_num_rows($stmt);
return $numero_filas;
$stmt->close();
}
Error that launches
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, object given in C:\xampp\htdocs\Inventarios\models\Rollos.php on line 13
How can I resolve this error? Thanks