public static function getCreateTable($tbl): string
    {
        if (isset(self::$cached_create_table_statements[$tbl])) {
            return self::$cached_create_table_statements[$tbl];
        }

        $sql = self::getInstance()->sql_query("SHOW CREATE TABLE `$tbl`");
        $q = $sql->fetch(PDO::FETCH_ASSOC);

        $str = '';

        if (isset($q['Create Table'])) {
            $str = strtr($q['Create Table'], ["\r" => '', "\n" => '', "\t" => '']);
        } elseif (isset($q['Create View'])) {
            $str = strtr($q['Create View'], ["\r" => '', "\n" => '', "\t" => '']);
        }

        return self::$cached_create_table_statements[$tbl] = $str;
    }
public static function getCreateTable($tbl): string
    {
        if (isset(self::$cached_create_table_statements[$tbl])) {
            return self::$cached_create_table_statements[$tbl];
        }

        $sql = self::getInstance()->sql_query("SHOW CREATE TABLE `$tbl`");
        $q = $sql->fetch(PDO::FETCH_ASSOC);

        $str = '';

        if (isset($q['Create Table'])) {
            $str = strtr($q['Create Table'], ["\r" => '', "\n" => '', "\t" => '']);
        } elseif (isset($q['Create View'])) {
            $str = strtr($q['Create View'], ["\r" => '', "\n" => '', "\t" => '']);
        }

        return self::$cached_create_table_statements[$tbl] = $str;
    }
public static function getCreateTable ( $ tbl ) : string { if ( isset ( self :: $ cached_create_table_statements [ $ tbl ] ) ) { return self :: $ cached_create_table_statements [ $ tbl ] ; } $ sql = self :: getInstance ( ) -> sql_query ( "SHOW CREATE TABLE `$tbl`" ) ; $ q = $ sql -> fetch ( PDO :: FETCH_ASSOC ) ; $ str = '' ; if ( isset ( $ q [ 'Create Table' ] ) ) { $ str = strtr ( $ q [ 'Create Table' ] , [ "\r" => '' , "\n" => '' , "\t" => '' ] ) ; } elseif ( isset ( $ q [ 'Create View' ] ) ) { $ str = strtr ( $ q [ 'Create View' ] , [ "\r" => '' , "\n" => '' , "\t" => '' ] ) ; } return self :: $ cached_create_table_statements [ $ tbl ] = $ str ; }
Get create table or create view statement

@param string $tbl - table name
@return string with full query
Get create table or create view statement