src/MysqliLib.php
public static function getTableColumnNames(\mysqli $mysqliConn, string $tableName) : array
    {
        $sql = "SHOW COLUMNS FROM `{$tableName}`";
        $result = $mysqliConn->query($sql);
        
        $columns = array();
        
        while (($row = $result->fetch_array()) != null)
        {
            $columns[] = $row[0];
        }
        
        return $columns;
    }
public static function getTableColumnNames(\mysqli $mysqliConn, string $tableName) : array
    {
        $sql = "SHOW COLUMNS FROM `{$tableName}`";
        $result = $mysqliConn->query($sql);
        
        $columns = array();
        
        while (($row = $result->fetch_array()) != null)
        {
            $columns[] = $row[0];
        }
        
        return $columns;
    }
public static function getTableColumnNames ( \ mysqli $ mysqliConn , string $ tableName ) : array { $ sql = "SHOW COLUMNS FROM `{$tableName}`" ; $ result = $ mysqliConn -> query ( $ sql ) ; $ columns = array ( ) ; while ( ( $ row = $ result -> fetch_array ( ) ) != null ) { $ columns [ ] = $ row [ 0 ] ; } return $ columns ; }
Fetches the names of the columns for a particular table.
@return array - the collection of column names
Fetches the names of the columns for a particular table .