Page 1 of 1

mssql problem

Posted: Sun Jan 12, 2003 3:34 am
by Guy
im using php with mssql 2000.
i use mssql_fetch_array to get the data from the database.
like :$line = mssql_fetch_array($rs);
but when i try to use $line["FIELDNAME"] to get the field value
i get nothing. if i'll use the offset number: $line[1]
i'll get the correct data.
FIELDNAME is smaller then 30 chars.
appriciate any help or insights
thanks
Guy

Posted: Mon Jan 13, 2003 3:06 am
by twigletmac
Check what's in the $line array by doing:

Code: Select all

$line = mssql_fetch_array($rs);
echo '<pre>';
print_r($line);
echo '</pre>';
Mac

mssql problem

Posted: Mon Jan 13, 2003 7:11 pm
by fractalvibes
Actually, I have seen this problem when I first tried accessing DB stored procedures via ADO/ASP - field names did not come across, just had to access the recordset fields as
rs.fields(0), rs.fields(1).....etc.

Turns out it was a configuration setting in DB2 that needed to be switched on.

I'll be this is a similar issue with your SequelServer!

Phil J.