Re: mssql & freetds & php4 & linux

From: Date: Sat, 06 Oct 2001 04:54:06 +0000
Subject: Re: mssql & freetds & php4 & linux
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70197@lists.php.net to get a copy of this message
Just for the sake of argument... Try these: A) Don't pass in the optional $CNO1 variable B) Do $CNO1_copy = $CNO1; first, and see if it survives. I'd also say file a bug report at http://bugs.php.net Unless, you've done something really silly like type 'oh' (O) instead of 'zero' (0) or something... -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Christopher William Wesley <cwwesley@udlug.org> Newsgroups: php.general To: <php-general@lists.php.net> Sent: Friday, October 05, 2001 8:48 PM Subject: mssql & freetds & php4 & linux > I'm running php 4.0.6.7rc2-3 with freetds 0.52-3 support on a debian linux > server. This is a winning combination to work with MSSQL2000. However > I'm running into some odd behavior when performing multiple queries on the > same connection (link) identifier. > > I create a connection to the dbms and select a database. Then I perform > an insert. > [ $CN01 = mssql_connect('host','uname','passwd'); > mssql_select_db('mydb',$CN01); > $RS01 = mssql_query("insert into foo values ('bar1','bar2')", > $CN01); ] > > I folllow this operation by a select on table 'foo'. > [ $RS02 = mssql_query("select * from foo", $CN01); ] > > This second query is never successful. It appears that the link ($CN01) > is destroyed after the first query (the insert). When I print $CN01 > before the first query, it's value is "Resource id #1" but when I print > $CN01 after that query and before the second query, it is null. > > I can successfully perform the second query by opening a new connection to > the dbms and using it for the second query. ALSO, I can successfully > perform the queries in reverse order, select first then insert, without > using a new connection. (A bit more experimentation shows I don't have > this problem with mod_perl.) I've also tried this with the sybase_*() > functions, and I get the same results. > > Is there any reason why I must open a new connection to perform a select > after performing an insert on an mssql2K table [using php]? > > THX, > ~Chris /"\ > \ / September 11, 2001 > X We Are All New Yorkers > / \ rm -rf /bin/laden >

« previous php.general (#70197) next »