Results 1 to 2 of 2

Thread: grab column names from DB [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    grab column names from DB [Resolved]

    I'm using the following:
    PHP Code:
    $query "SELECT * "
    $query .= "FROM Vendor "
    $query .= "WHERE ID = " $id

    $result mssql_query($query); 
    $row mssql_fetch_array($result); 
    To grab information about a vendor. I take the query results (ie. $row[5]) and stuff that into a text box.

    Is there any good way to get the name of the column that it came from? In other words, I'm trying to avoid typing the name for each element into the name of the textbox. This isn't a horrible way to do it, however, because the results have to be laid out very specifically so it's not like I can just put the whole thing in a loop.

    Make sense?

    Is there a way to do like "SELECT ColumnNames FROM tablexyz" or something?
    Last edited by ober0330; Feb 20th, 2004 at 09:23 AM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

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



Click Here to Expand Forum to Full Width