src/MVQN/Data/Database.php
public static function select(string $table, array $columns = [], string $orderBy = ""): array
    {
        // Get a connection to the database.
        $pdo = self::connect();

        // Generate a SQL statement, given the provided parameters.
        $sql =
            "SELECT ".($columns === [] ? "*" : "\"".implode("\", \"", $columns)."\"")." FROM \"$table\"".
            ($orderBy !== "" ? " ORDER BY $orderBy" : "");

        // Execute the query.
        $results = $pdo->query($sql)->fetchAll();

        // Return the results!
        return $results;
    }
public static function select(string $table, array $columns = [], string $orderBy = ""): array
    {
        // Get a connection to the database.
        $pdo = self::connect();

        // Generate a SQL statement, given the provided parameters.
        $sql =
            "SELECT ".($columns === [] ? "*" : "\"".implode("\", \"", $columns)."\"")." FROM \"$table\"".
            ($orderBy !== "" ? " ORDER BY $orderBy" : "");

        // Execute the query.
        $results = $pdo->query($sql)->fetchAll();

        // Return the results!
        return $results;
    }
Issues a SELECT query to the database.

@param string $table The table for which to make the query.
@param array $columns An optional array of column names to be returned.
@param string $orderBy An optional ORDER BY suffix for sorting.
@return array Returns an associative array of rows from the database.
@throws Exceptions\DatabaseConnectionException