Click to See Complete Forum and Search --> : apache 2, php 4.0.8 works but. err


Anon
12-05-2001, 01:26 AM
I have apache 2.0 php4.0.8 running on w2k splendidly.. however the wierdest thing...

on all my applications mssql results return blank filed values? odd.

for example

a list that once returned

joe - blow
sam - mcgee
dan - mcgrew
lee - iowecoca
robert - service

now gives me

-
-
-
-
-

??
the right number of records but blank values.

what would cause this change between 4.0.6 and 4.0.8?

Anon
12-05-2001, 02:14 AM
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"); ?>

Anon
12-05-2001, 03:14 AM
update..

narrowed it down to


while ($f=mssql_fetch_array($r))
{
for($i=0; $i<1;$i++){
//$projects.=("$f[0] - $f[2] <br>\n");
$projects.=($f["Project_Name"]." - $f[2] <br>\n");
//$projects.= mssql_result($r,$i,$i);
}


calling by the field name:
$f["Project_Name"] - works

but by array index $f[2] does not any longer, since upgrading to 4.0.8

again.. is this just