MSSQL - first insert succeeds, second one fails .
WassonT at kochind.com
Mon Oct 9 10:04:38 EDT 2000
The symptoms are: The select will work fine. The insert will actually put
data into the table, which I have verified with a query on the db on the
Winbox. However, the page generates the "Document contained no data" error
The topofpage.php3 is used to provide the StartPage and endpage functions
and is used in many other places with no problems. It's not a permissions
problem since the insert actually succeeds. In my previous post I thought
it was hanging on the second insert try, but it's actually hanging on the
first attempt, as I discovered in preparing this short test script.
If I comment out the $otherjunk=mssql_query($query); line, the script runs
fine. Add the line back in and it hangs.
// this script is running on a Slackware 7.0 box
StartPage("Testing a problem");
// DJANGO is a MSSQL 6.5 db on an NT4 box.
// tblCargo contains only one field named Type and it's a varchar 255
$sqlcon = mssql_connect($servername, $user, $password);
print("Try the select");
$query="SELECT * FROM tblCargo";
print("Try the insert");
$query="INSERT INTO tblCargo (Type) VALUES('4545')";
// this is the line that causes the problem.
> -----Original Message-----
> From: Brian Bruns [SMTP:camber at ais.org]
> Sent: Friday,October 06,2000 5:52 PM
> To: TDS Development Group
> Subject: [freetds] Re: MSSQL - first insert succeeds, second one
> Hi Tim,
> Please post a script that demonstrates this, please include any table
> definitions that are relevant to the script.
> On Fri, 6 Oct 2000, Wasson, Tim wrote:
> > Setup: MSSQL 6.5 or 7.0 database backend, PHP on Linux.
> > I'm parsing an XML string passed as a POST from an Excel sheet. I'm
> > to do an insert into a mssql database each time I get to a certain tag.
> > parsing is working fine, and I can do selects out of the database in the
> > parsing loop, but as soon as I try to do an insert, it does to do the
> > insert and then hangs on the second insert. The permissioning on the db
> > ok, because I can see the first attempt makes it into the db, but no
> > I found something in the bugtracking db about errors getting raised if
> > was still a query pending when it tried to do another. Not sure what
> > means exactly.
> > Thanks for your help everyone...
> > Tim Wasson
> > Koch Industries
> > Wichita KS
> You are currently subscribed to freetds as: [WassonT at kochind.com]
> To unsubscribe, forward this message to
More information about the FreeTDS