Skip to Content.
Sympa Menu

freetds - Re: [freetds] Query failing when following a insert

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT axelero.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Query failing when following a insert
  • Date: Mon, 15 Dec 2003 23:34:41 +0100


On Dec 15, 2003, at 20:59, Chris Hettinger wrote:

My environment:
Apache / PHP on Mdk 9.1 Linux.
PHP has been compilied with the db driver and TDS library
Connecting to a MS SQL 7 db.

Give us some more version information. Apache, FreeTDS, PHP and what configure command you used to build PHP.
Using my little test script will give you some, but not all, of that information:
http://web.axelero.hu/fdsoft/temp/freetds_test.zip

I have a script that initially does a insert into a table in the mssql db,
immediately after the insert I need to identify the ID that was generated
and used on that record so I query the same table where some of the details
match and grab the id... However the second sql execution fails.
It returns no records.
To test this I did another test where I do a insert and immediately after
that I do a select from a different table within a differnet database all
together, and it also fails, returning no records.

Your problem sounds a lot like what an ex-colleague of mine once experienced with long forgotten, ancient versions of PHP and FreeTDS. FreeTDS was 0.53 or earlier, PHP around the 4.1x line or so.

The workaround was to add a useless and trivial query in the middle, such as a simple "SELECT 1"

My suggestion is to upgrade to the latest final version of PHP (4.34) and either 0.61 of FreeTDS or even the daily snapshot as those tend to be even more stable than the old one.

--
fds





Archive powered by MHonArc 2.6.24.

Top of Page