actually this works using mssql_field_name.
....
for ($field_number = 0 ; $field_number <= $number_fields - 1 ;
$field_number++ )
{
$field_name = mssql_field_name($query_result, $field_number) ;
print "<b>" . $field_name . "</b><br>" ;
}
But... using fetch array.. i get the array with blank field names.. why? maybe a change in my php.ini when i upgraded?
example worked fine before in 4.0.6 but in 4.0.8 gives blank
<?
function list_projects($u,$p,$s){
$q = "sp_list_projects @User_Id ='$u'";
global $project_list;
$connection = mssql_connect("server","joe","snit");
mssql_select_db("wmm");
$r = mssql_query($q,$connection);
$n = mssql_num_rows($r);
$t = mssql_num_fields($r);
while ($f=mssql_fetch_array($r))
{
for($i=0; $i<1;$i++){
if ($f[1]==$p){$project_list.=("<option selected value=\"$f[1]\" > $f[0] </option>\n");}
else {$project_list.=("<option value=\"$f[1]\" > $f[0] </option>\n");}
}
}
echo($project_list);
}
?>
<? list_projects("1","61","silver"); ?>