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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]