用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2096|回复: 2
收起左侧

[HELP] 求问高手,这是什么错误

[复制链接]
发表于 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
这是为什么啊?
发表于 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呢?
发表于 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有错
再者, 两台机器连的是不是同个数据库,数据表结构是不是一样的?

本版积分规则