function leer_cuotas($dbhandler) { $query = "SELECT * FROM Cuota"; $table = $dbhandler->query($query); $result = array(); if ($table->num_rows > 0) { // output data of each row while ($row = $table->fetch_assoc()) { $cuota = new Cuota(); $cuota->read_cuota($row); $result[] = $cuota; } } else { echo "no results"; } return $result; }