Skip to Content.
Sympa Menu

freetds - Re: Insert/update returns failure using PHP sybase_query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Darryl Friesen" <Darryl.Friesen AT usask.ca>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Insert/update returns failure using PHP sybase_query
  • Date: Thu, 1 Nov 2001 16:39:11 -0600


> Here's my problem, when I submit an insert or update query using the PHP
> sybase_query function, the insert or update successfully completes but PHP
> returns a failure status, and I think the connection is then marked dead
> as any following insert/update fails to complete.

I think it's a PHP bug, not a FreeTDS bug. This happens with any query that
does not return rows (i.e. INSERT, UPDATE and DELETE). The only workaround
I've found it to make sure the query returns something by tacking on a
select query, something like "SELECT @@IDENTITY" (if appropriate), "SELECT
@@ROWCOUNT" or "SELECT @@VERSION". So long as the query returns a value,
PHP won't close the connection on you. In your case try:

sybase_query("insert dave values (1,1); select @@VERSION;", $cnn)

Does this suck? Yep.


- Darryl

----------------------------------------------------------------------
Darryl Friesen, B.Sc., Programmer/Analyst Darryl.Friesen AT usask.ca
Education & Research Technology Services, http://gollum.usask.ca/
Information Technology Services Division,
University of Saskatchewan
----------------------------------------------------------------------
"Go not to the Elves for counsel, for they will say both no and yes"






Archive powered by MHonArc 2.6.24.

Top of Page