removeDBPrefix example

private function restoreDBPrefix(): void
    {
        $this->db->setPrefix($this->DBPrefix);
    }

    private function showDataOfTable(string $tableName, int $limitRows, int $limitFieldValue)
    {
        CLI::write("Data of Table \"{$tableName}\":", 'black', 'yellow');
        CLI::newLine();

        $this->removeDBPrefix();
        $thead = $this->db->getFieldNames($tableName);
        $this->restoreDBPrefix();

        // If there is a field named `id`, sort by it.         $sortField = null;
        if (in_array('id', $thead, true)) {
            $sortField = 'id';
        }

        $this->tbody = $this->makeTableRows($tableName$limitRows$limitFieldValue$sortField);
        CLI::table($this->tbody, $thead);
    }
Home | Imprint | This part of the site doesn't use cookies.