Re: PHP4/mssql_query INSERT problems

From: Date: Tue, 16 Jul 2002 04:37:47 +0000
Subject: Re: PHP4/mssql_query INSERT problems
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-20569@lists.php.net to get a copy of this message
I updated the mdac drivers on the Win2000 that was running PHP4 on IIS and it seemed to resolve the problem. If anyone has good code for detecting errors after issuing mssql_query please post them. Thanks! Salve "Salve Tinkerworth" <tinkerworth@hotmail.com> wrote in message news:20020716010158.60257.qmail@pb1.pair.com... > Why do I keep getting messages like: > > INSERT INTO OPS (CampaignID,[Description],PhoneInventory,URLInventory) > VALUES (463,'In and Out','','') > Warning: MS SQL message: Line 1: Incorrect syntax near '463'. (severity 15) > in c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 > > Warning: MS SQL: Query failed in > c:\inetpub\wwwroot\intranet2\ccp\campaign_edit.html on line 62 > > for a simple insert like: > > $sql2="INSERT INTO OPS > (CampaignID,[Description],PhoneInventory,URLInventory) VALUES > > ($new_campaignid,'$Description','$PhoneInventory','$URLInventory')"; > > echo $sql2; > > $result=mssql_query($sql2); > $error=mssql_query('SELECT @@ERROR As ErrorCode'); > > if($error['ErrorCode'] != 0) { > echo $error['ErrorCode']; > echo $sql2; > die('Inserting OPS failed'); > } > >

« previous php.db (#20569) next »