I'm using the following:To grab information about a vendor. I take the query results (ie. $row[5]) and stuff that into a text box.PHP Code:$query = "SELECT * ";
$query .= "FROM Vendor ";
$query .= "WHERE ID = " . $id;
$result = mssql_query($query);
$row = mssql_fetch_array($result);
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?


Reply With Quote