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: "Chris Hettinger" <chettinger AT encompas.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Query failing when following a insert
  • Date: Mon, 15 Dec 2003 17:59:33 -0600



Handy little script, thank you, here are the results:

------------

PHP version: 4.3.1 (apache2filter)
System uname: Linux 2.4.21-0.13mdk
Process UID/GID: 72:72 (apache:apache)
PHP configure command: './configure' '--prefix=/usr' '--libdir=/usr/lib'
'--enable-discard-path' '--disable-force-cgi-redirect' '--enable-shared'
'--disable-static' '--disable-debug' '--disable-rpath' '--enable-pic'
'--enable-inline-optimization' '--enable-memory-limit'
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php'
'--with-pear=/usr/share/pear' '--enable-magic-quotes' '--enable-debugger'
'--enable-track-vars' '--with-exec-dir=/usr/bin' '--with-versioning'
'--with-mod_charset' '--with-regex=php' '--enable-track-vars'
'--enable-trans-sid' '--enable-safe-mode' '--enable-ctype' '--enable-ftp'
'--with-gettext=/usr' '--enable-posix' '--enable-session' '--enable-sysvsem'
'--enable-sysvshm' '--enable-yp' '--with-openssl=/usr' '--without-kerberos'
'--with-ttf' '--with-freetype-dir=/usr' '--with-zlib=/usr' '--with-zlib=/usr'
'--with-zlib-dir=/usr' '--with-mssql=/usr/local'
FreeTDS-related PHP extension(s) loaded: mssql

MSSQL functions exist, testing connection: connected to server 'ENCPPP'
Trying a test query: Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

------------

Other Versions:
Apache : Apache-AdvancedExtranetServer/2.0.47 (Mandrake Linux/1.1mdk)
(cont) : mod_perl/1.99_08 Perl/v5.8.0 mod_ssl/2.0.47 OpenSSL/0.9.7a PHP/4.3.1
Adodb : adodb401
FreeTDS : freetds-0.62.dev.20030805


-Chris




-----Original Message-----
From: Daniel Fazekas [mailto:fdsubs AT axelero.hu]
Sent: Monday, December 15, 2003 4:35 PM
To: FreeTDS Development Group
Subject: Re: [freetds] Query failing when following a insert



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

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds


CONFIDENTIALITY NOTICE: This communication, including any attachment, may
contain confidential information and is intended only for the individual or
entity to whom it is addressed. Any review, dissemination, or copying of
this communication by anyone other than the intended recipient is strictly
prohibited. If you are not the intended recipient, please contact the sender
by reply email, delete and destroy all copies of the original message.'





Archive powered by MHonArc 2.6.24.

Top of Page