{ $ret = array(); $results = $this->con->query($command, MYSQLI_USE_RESULT); while ($row = $results->fetch_row()) { array_push($ret, $row); } return $ret; } // Counts rows retrieved from query public function queryCount($command) { $results; $count = 0; if ($results = $this->con->query($command)) { $count = $results->num_rows; } return $count; } public function close() { $this->con->close(); } } $connection = new dbconnect("192.168.1.20", "jeegna", "password", "just_lee"); $connection->initializeConnection(); $i = $connection->query("SELECT * FROM AUTHOR"); foreach ($i as $j) { $k = $j[1]; echo $k . " : "; } $connection->close();