Re: DB/mssql.php small glitch

From: Date: Mon, 16 Dec 2002 14:23:43 +0000
Subject: Re: DB/mssql.php small glitch
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11710@lists.php.net to get a copy of this message
Am Mon, 16 Dec 2002 15:26:26 +0200 schrieb "Yavor Shahpasov" <yavo@nicosia.com.cy>: > I have noticed the mssql extension uses mssql_fetch_array when using > DB_FETCHMODE_ASSOC as stated in the manual this function returns _both_ the > nmeric and assosiative indexes. I propose using the mssql_fetch_assoc > function instead. I remember someone making a note about this on the list. I > think he got ignored. can the maintener of mssql do this. if he is not > available can some one please fix this on line 156 of DB/mmsql.php > > change > $ar = @mssql_fetch_array($result); > to > $ar = @mssql_fetch_assoc($result); In principle you are right, but there are some things to consider: It´s stated everywhere in the PHP docs that when you´re on Linux, you can use the Sybase extension to have access to PHP´s mssql_* functions. What the manual doesn´t say is that not all of the mssql-functions are available this way - mssql_fetch_assoc() is one of them. Try to call it on Linux where PHP was compiled using --with-sybase. Result: "Call to undefined function". So IF this change is really made, we´d better make sure that there´s a huge warning sign in the PEAR::DB manual, stating that you should use "sybase" in your DSN if you´re trying to connect to an MSSQL server from a Linux box. I´ve had a lot of trouble the last few weeks trying to find out why the tableInfo() method wasn´t working on my Linux box, while it was working very well on Windows. I never found any clue in the docs, so I thought it must actually be my system that´s f...ed up. After a while, I found out that the functions that tableInfo() uses in DB´s MSSQL driver are only supported by the original MSSQL extension under Windows. Several hours of configuration and frustration for nothing :-( Regards, Markus -- *21st Media* | Consulting, Konzeption, Produktion für die Bereiche: Markus Wolff | Internet, Intranet, eCommerce, Content Management, Hamburg,Germany | Softwareentwicklung, 3D-Animation, Videostreaming http://21st.de | Tel. [+49](0)40/6887949-0, Fax: [+49](0)40/6887949-1

« previous php.pear.dev (#11710) next »