Ver también

User Contributed Notes 14 notes

It seems that this function creates arrays wich keys can not be longer than 30 chars. So when you're having a DB-field like "this_is_a_very_long_db_field_name"its array-key is cut off after 30 chars and you will have to access the value withrs["this_is_a_very_long_db_field_n"]

A null value will return 0, this is a problem if you are using 0 and some identifier for a value. you should convert all nulls to something like -1 or "NO VALUE"

******

After extensive testing, the above statements both seem to be true. You *can* distinguish between 0 and null values in PHP; however, the mssql_fetch_array function does not set null colums to the php NULL value.

if ($row['Null_Column'] === 0) { print('pass'); }

A null column passes the above test. Seems to be a bug in the function.

"Previously mssql data was always rtrimed, however that's wrong because it modifies the original data. This caused a problem for people who needed those trailing space. Ultimately, the job of database extension is to fetch the data as is (like other db extensions already do) and not to mangle it in any way."

Allthough probably obvious to people who have used the functions available to other databases it during writing is not present in this entry that result type can be entered as MSSQL_ASSOC or MSSQL_NUM, and the default value when nothing entered being MSSQL_BOTH

After further testing, it appears as though the null column bug only affects windows installations. On my linux installation using freetds-0.61.2, the function behaves properly. It must exist either in the php_mssql.dll or the Microsoft connection libraries. And since I use this functionality through ASP as well (which uses the Microsoft connection libraries), it would lead me to believe that it's an issue within the php_mssql.dll.

There is any option like skip or go next ! I am using a while clause inside: While ($row=mysql_fetch_array($result)) while ($row["Brand_name"]=$gr){ ....So I am printing different TD from classes and when I finish cycling the fields I want to "skip" to next record !