This is the statement before:
$sql1="INSERT INTO Campaigns
(Campaign,JobID,Client,SoldBy,SalesAssociate,Sales,PM,TestDate,LiveDate,EndD
ate,IVR,[Int],PRF)
VALUES('".$$Camp_entity."','$JobID','$Client','$SoldBy','$SalesAssociate','$
AE','$PM',$TestDate,$LiveDate,$EndDate,'$IVR','$Int','$PRF')";
The connection is in a include file and looks like this:
$start=microtime();
$host='192.168.72.7';
$db='PaqTrac';
$db_user='PaqTrac';
$db_pw='jobcontrol';
//connect to DB
mssql_connect($host,$db_user,$db_pw) or die ("Sorry, couldn't connect to
database.");
mssql_select_db($db);
I've tried numerous things. What's funny is the following works but only
sometimes:
$result=mssql_query($sql1);
$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
Salve
"Andrew Hill" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> 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 (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php