freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: MSSQL - first insert succeeds, second one fails .
- From: "Wasson, Tim" <WassonT AT kochind.com>
- To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
- Subject: Re: MSSQL - first insert succeeds, second one fails .
- Date: Mon, 9 Oct 2000 09:04:38 -0500
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
in Netscape.
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
require("/usr/analysis/website/topofpage.php3");
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
$servername="DJANGO";
$user="wassont";
$password="fuzzy";
$database="datedbrent";
$sqlcon = mssql_connect($servername, $user, $password);
mssql_select_db($database, $sqlcon);
print("Try the select");
$query="SELECT * FROM tblCargo";
$junk=mssql_query($query);
print("Try the insert");
$query="INSERT INTO tblCargo (Type) VALUES('4545')";
// this is the line that causes the problem.
$otherjunk=mssql_query($query);
endpage();
?>
> -----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
> fails.
>
> Hi Tim,
>
> Please post a script that demonstrates this, please include any table
> definitions that are relevant to the script.
>
> Brian
>
> 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
> trying
> > to do an insert into a mssql database each time I get to a certain tag.
> The
> > 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
> first
> > insert and then hangs on the second insert. The permissioning on the db
> is
> > ok, because I can see the first attempt makes it into the db, but no
> more.
> >
> > I found something in the bugtracking db about errors getting raised if
> there
> > was still a query pending when it tried to do another. Not sure what
> that
> > 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
> $subst('Email.Unsub')
-
Re: MSSQL - first insert succeeds, second one fails .,
Wasson, Tim, 10/09/2000
- <Possible follow-up(s)>
- Re: MSSQL - first insert succeeds, second one fails ., Wasson, Tim, 10/09/2000
Archive powered by MHonArc 2.6.24.