简体   繁体   中英

MSSQL query in CodeIgniter

I want to run MSSQL query in CodeIgniter framework but it is throwing error like:

Error Number: 42S22/207

[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid column name '1'.

SELECT * FROM user_master WHERE id ="1"

I'm trying to run following query:

SELECT id,fname,lname,username,email FROM user_master WHERE username ="admin" AND password ="123456"

when this same query into MSSQL, it works with a single quotation ('). But when I'm passing variables in the query then it is automatically assigned double quotation.

Suggest some solution.

I faced this issue a while ago I tried turning on query builder in database.php

$query_builder = TRUE;

there might be issue with IIS server cache. Clear cache and try.

I hope this will work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM