This is the statement before:

$sql1="INSERT INTO Campaigns

The connection is in a include file and looks like this:


//connect to DB
mssql_connect($host,$db_user,$db_pw) or die ("Sorry, couldn't connect to

I've tried numerous things. What's funny is the following works but only

$error=mssql_query('SELECT @@ERROR As ErrorCode');
if($error['ErrorCode'] != 0) {
 echo $error['ErrorCode'];
 echo $sql1;
 die('Inserting Campaign failed');

This works for while until suddenly the subsequent insert statements
statements start failing. I'll restart the server and everything will work
fine for a bit. I inherited this app and although it's giving me hell I am
enjoying PHP which I've never worked with before.

It was originally PHP3 but when I migratated it here locally I installed
PHP4. I'm running IIS on Win2k and the backend is MSSQL2k although I have a
copy on MSSQL7 which hasn't made a difference.

Right now I'm re-servicepacking the OS out of desperation. :-P

"Andrew Hill" <[EMAIL PROTECTED]> wrote in message
> Salve,
> Not sure if the MDAC version is necessarily the culprit - it's probably
> something else.
> What do you have earlier in your script?  Are you catching errors on the
> connect?
> Best regards,
> Andrew Hill
> OpenLink Software
> > Is there a recommended MDAC version for PHP when accessing SQL Server
> > 2000? Right now the following statement successfully inserts data but
> > always results with the die message:
> >
> > $result = mssql_query($sql1) or die('inserting campaign failed');
> >
> >
> >
> > --
> > PHP Database Mailing List (
> > To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to