I can not show the data that the query brings me. I work with mySQL and a model of views and controllers.
I get this error: Warning: mysqli_num_rows () expects parameter 1 to be mysqli_result, string given in . And the variable is not empty.
public function listaTarjetas(){
$db=BaseDeDatos::conectarBD();
$sql='select * from tarjetas;';
$result=mysqli_query($db, $sql);
return $result;
}
$usuario = new Model_Usuario();
$tarjetas = $usuario->listaTarjetas();
<?php if(mysqli_num_rows($data)>0){
while($rows=mysqli_fetch_assoc($data)){
echo $rows['idTarjetas'];
}
} ?>