Re: Code bombs connecting to MSSQL 7
| From: | Andrew Hill | Date: | Sat, 07 Apr 2001 04:45:14 +0000 |
| Subject: | Re: Code bombs connecting to MSSQL 7 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8330@lists.php.net to get a copy of this message | ||
John,
The quotes are throwing it. Try single or no quotes.
Best regards,
Andrew
---------------------------------------
Andrew Hill - Director Technology Evangelism
OpenLink Software - http://www.openlinksw.com
Internet Data Integration Technology
On 4/6/01 4:30 PM, "John A DAVIS" <John.A.DAVIS@state.or.us> wrote:
> THE SQL STATEMENT:
> $data = odbc_do($connection, "Select Distinct [ActivityStatus],
> [WaterSystemStateCode], [WaterSystemName], [PopulationServed], [SeasonBegins],
> [SeasonEnds], [SystemType], Contact, Phone, County, Connections, Address,
> CityStateZip From viewInventory Where [WaterSystemStateCode]=\"OR4100100\"");
> <<BOMBS HERE
>
> THE ERROR:
> Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid
> column name 'OR4100100'., SQL state S0022 in SQLExecDirect in C:/Program
> Files/Apache13 14/Apache/htdocs/sdwis/inventry.php3 on line 21
>
>
> VERIFICATION:
> the field value "OR4100100" exists in the table TINWSYS in the "Number0"
> column(alias: "WaterSystemStateCode"). The same query works in Access linked
> to the MSSQL 7 server. . .
>
> THIS WORKS:
> $data = odbc_do($connection,"Select * From viewInventory");
>