getting table meta info

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian

    getting table meta info

    I can query a table in a MySQL database for meta info using

    SHOW TABLE STATUS LIKE 'images'

    That gives me a single row result of info (Name, Type, Row_format, Rows,
    Avg_row_length, etc. But how do get one field from that record in PHP?
    Here's what I have so far:

    $sqlstatement = 'SHOW TABLE STATUS LIKE \'images\'';

    $result = mysql_query($sq lstatement) or die("Query failed : " .
    mysql_error());

    I don't know how to reference a field from $result.

    --
    Brian (remove "invalid" from my address to email me)

  • Andy Hassall

    #2
    Re: getting table meta info

    On Sat, 15 May 2004 15:40:03 -0400, Brian <usenet3@juliet remblay.com.inv alid>
    wrote:
    [color=blue]
    >I can query a table in a MySQL database for meta info using
    >
    >SHOW TABLE STATUS LIKE 'images'
    >
    >That gives me a single row result of info (Name, Type, Row_format, Rows,
    >Avg_row_length , etc. But how do get one field from that record in PHP?
    >Here's what I have so far:
    >
    >$sqlstatemen t = 'SHOW TABLE STATUS LIKE \'images\'';
    >
    >$result = mysql_query($sq lstatement) or die("Query failed : " .
    >mysql_error()) ;
    >
    >I don't know how to reference a field from $result.[/color]

    Same way as for an ordinary result set, with one of the mysql_fetch_*
    functions.

    --
    Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
    http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

    Comment

    Working...