# [EMAIL PROTECTED] / 2007-01-21 03:05:49 -0500:
> I am trying to do a DESC table_name using PHP so it looks like it would it
> you did it from the command line.
> 
> i.e. 
> 
> | Field     | Type         | Null | Key | Default | Extra          |
> +-----------+--------------+------+-----+---------+----------------+
> | id        | int(11)      | NO   | PRI | NULL    | auto_increment | 
> | name      | varchar(30)  | NO   |     | NULL    |                | 
> 
> What I have found is that the following does not work the way I would have
> thought.
> 
>       $query = "DESC table ".$currenttb;
>       $result = mysql_query($query);
        
>       while ($row = mysql_fetch_row($result)) {
>               etc.....

DESC is not a sql command, it's specific to the mysql(1) command line
client.

> I have found something that works, but it is still not like the above and is
> really bulky. I can not get the type (varchar, etc) to show like above, it
> will show string, blob, etc, and the last problem is it puts the last 4
> fields in one variable (flags).

What you've found is similar to what mysql(1) does when you send
DESC mytable.

> Does anyone know of a way to get this to output as shown above. I am putting
> this into a form for editing, so I need everything in the proper places.

Finish your effort to produce the desired output. You're almost there.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to