mssql problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

mssql problem

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

mssql problem

Post 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.
Post Reply