韶聪 发表于 2011-4-25 16:55:19

求问高手,这是什么错误

同样的代码,放在不同的机子上运行,一台计算机显示正常,另一台运行时,页面报这样的错
A Database Error Occurred

Error Number: 1064

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 'and t1.modelid = t2.id and t2.isvalid = 1' at line 5

select t2.modelname, t2.url from shutcuts as t1 inner join models as t2 on t1.userid = and t1.modelid = t2.id and t2.isvalid = 1
这是为什么啊?

zhouli520 发表于 2011-4-25 17:26:55

select t2.modelname, t2.url from shutcuts as t1 inner join models as t2 on t1.userid = and t1.modelid = t2.id and t2.isvalid = 1

t1.userid呢?

baiyuxiong 发表于 2011-4-25 17:45:42

select t2.modelname, t2.url from shutcuts as t1 inner join models as t2 on t1.userid = and t1.modelid = t2.id and t2.isvalid = 1
你的SQL有错
再者, 两台机器连的是不是同个数据库,数据表结构是不是一样的?
页: [1]
查看完整版本: 求问高手,这是什么错误