开发者

MySQL Syntax Error When Using Data From MSSQL Imported Tables

I have imported a number of tables (structure and data) from an MSSQL D开发者_如何学GoB into mysql - all data is in UTF8

I can pull data from the old tables, but when I use any of the data from the imported tables in a query from PHP I get a syntax error like this:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''data' at line 1

for this query

SELECT * FROM tableName WHERE field='data'

This only happens if executing the query from PHP, if I echo out the query from php and then copy, paste and execute the query from phpmyadmin then it runs fine.

Any ideas???

I'm using PHP 5.2.17 running on Apache 1.3.42 and MySQL 4.1.22-standard


If you using query like this then query should be :

E.G "SELECT * FROM tableName WHERE field='data'"; or 'SELECT * FROM tableName WHERE field="data"';

Please check for "Field" data-type whether is Varchar or sumthing else!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜