SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Apr 2001
    Location
    Michigan
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Displaying Table describtion with php

    is it possible to run the query:
    describe table
    using php script and if so how would it be done. Thanks for any help. It's greatly appreciated. I've tried but i can't get it to display the info how it would using mysql.

  2. #2
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have not ever tried it...

    (time to experiment! )
    John

  3. #3
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The output format bites, but it gives you something to work with:

    PHP Code:
    $query "DESCRIBE [table name]";
    mysql_query$query );
    while( 
    $row mysql_fetch_row($result) )
      {
        foreach( 
    $row as $element )
        {
          
    $bodyContent .= $element " : ";
        }
      } 
    John


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •