method getColumnValues documentation in bbn\Db\Engines

Return a numeric indexed array with the values of the unique column ($field) from the selected $table

Example

X::dump($db->getColumnValues('table_users','surname',['id','>',1])); /* array [ "Smith", "Jones", "Williams", "Taylor" ] function($table, string $field = NULL, array $where = [], array $order = [], int $limit = 0, int $start = 0) { /** * Return an indexed array with the first result of the query or false if there are no results. * * @param string $query * @return array|false */ public function fetch(string $query); /** * Return an array of indexed array with all results of the query or false if there are no results. * * @param string $query * @return array|false */ public function fetchAll(string $query); /** * @param $query * @param int $num * @return mixed */ public function fetchColumn($query, int $num = 0); /** * @param $query * @return bool|\stdClass */ public function fetchObject($query); /** * @return array */ public function getCfg(): array; /** * Gets the created hash. * * @return string */ public function getHash(): string; /** * Checks if the database is ready to process a query. * @return bool */ public function check(): bool; /** * Sets the error mode. * * @param string $mode */ public function setErrorMode(string $mode); /** * @return string */ public function getErrorMode(): string; /** * Returns the last error. * * @return string|null */ public function getLastError(): ?string; /** * Returns the current database selected by the current connection. * * @return string|null */ public function getCurrent(): ?string; /** * Returns the host of the current connection. * * @return string|null */ public function getHost(): ?string; /** * @return string */ public function getConnectionCode(); /** * Return the last config for this connection. * * @return array|null */ public function getLastCfg(): ?array; /** * @param array $cfg The user's options * @return array|null The final configuration */ }

Return a numeric indexed array with the values of the unique column ($field) from the selected $table BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.