function getOneRecord() { $record = new lmbMysqliRecord(); $queryId = $this->connection->execute($this->getSQL()); $values = Mysqli_fetch_assoc($queryId); $record->import($values); Mysqli_free_result($queryId); if (is_array($values)) { return $record; } }
function at($pos) { $query = $this->query; if (is_array($this->sort_params)) { $query .= ' ORDER BY '; foreach ($this->sort_params as $field => $order) { $query .= $this->connection->quoteIdentifier($field) . " {$order},"; } $query = rtrim($query, ','); } $queryId = $this->connection->execute($query . " LIMIT {$pos}, 1"); $res = Mysqli_fetch_assoc($queryId); Mysqli_free_result($queryId); if ($res) { $record = new lmbMysqliRecord(); $record->import($res); return $record; } }