table_name} {$letter}","{$row->table_name} ({$row->table_rows} rows {$row->table_comment})"); } mysql_free_result($res); return $result; } static function get_columns($prefix,$alias) { $result = array(); $prefix .= '..'; $prefix = explode('.', $prefix); if ($prefix[0]=='' or $prefix[1]=='') return array(); $database = mysql_escape_string($prefix[0]); $table = mysql_escape_string($prefix[1]); $prefix = mysql_escape_string($prefix[2]); $res = mysql_query("SELECT column_name, column_type, column_comment FROM information_schema.columns WHERE table_schema = '{$database}' AND table_name = '{$table}' AND column_name like '{$prefix}%'"); if ($alias==null) $alias = "{$table}."; $result[] = array("","---- {$table} ({$database}) ----"); while ($row = mysql_fetch_object($res)) { $result[] = array("{$alias}{$row->column_name}","{$row->column_name} ({$row->column_type} {$row->column_comment})"); } mysql_free_result($res); return $result; } } mysql_close(); ?> Database: