Re: Re: mssql & freetds & php4 & linux
| From: | Christopher William Wesley | Date: | Sat, 06 Oct 2001 06:05:42 +0000 |
| Subject: | Re: Re: mssql & freetds & php4 & linux | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70204@lists.php.net to get a copy of this message | ||
On Fri, 5 Oct 2001, Richard Lynch wrote:
> Try these:
> A) Don't pass in the optional $CNO1 variable
I tried this previously, and got the same, undesired results.
> B) Do $CNO1_copy = $CNO1; first, and see if it survives.
I just tried this [upon your input], and my second query failed still.
> I'd also say file a bug report at http://bugs.php.net
> Unless, you've done
It appears that someone has stumbled upon a similar problem. (I'm willing
to bet it's the same problem.) http://bugs.php.net/bug.php?id=13008 I'll
keep an eye on it. (I wish I could append to the bug report, instead of
waiting, or submitting [what I believe would be] a redundant report.)
> something really silly like type 'oh' (O) instead of 'zero' (0) or
> something...
... or try to talk to a MSSQL2K dbms from Linux? Yeah, that's pretty darn
silly! (I'm actually trying to replace a farm of Win2K servers running
IIS + ASP with Linux/Apache + PHP ... I'll take the small victory :)
Thanks for your time,
~Chris /"\
\ / September 11, 2001
X We Are All New Yorkers
/ \ rm -rf /bin/laden
> ----- Original Message -----
> From: Christopher William Wesley <cwwesley@udlug.org>
>
> > 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]?