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?