0
如何在ImpressPages 4.x中使用大于或小于sql的条件(<
,>
,<=
,>=
)。我试图像下面,但我对ipDb()->update()
和ipDb()->delete()
功能得到了错误:ImpressPages 4.x数据库,其中条件大于或小于
ipDb()->delete('Persons', array('age <=' => 18));
ipDb()->delete('Persons', array('age >' => 80));
ipDb()->delete('Persons', array('age <' => 25));
ipDb()->delete('Persons', array('age >=' => 41));
的错误:
Column not found: 1054 Unknown column 'age <=' in 'where clause'' in
是否这样? ('age'=> $ age));'我应该使用'execute'查询吗? – Bora 2014-10-27 10:40:31
是这样的。它不适合你吗?有两件事我很关注: 1表名没有前缀。使用 $ table = ipTable('Persons'); IPDB() - >执行(“UPDATE $表SE ... 2.我不知道如果MySQL支持这里的空间‘<=’ 但在一般的思路是正确的打开错误报告。如果你没有看到任何错误 – 2014-10-27 14:43:54
它运作良好我只是写作样本是错误的,应该是'age <=:age' – Bora 2014-10-27 16:32:45