doudou8783 2012-04-07 06:15
浏览 30
已采纳

too long

i am using Codeigniter i am facing an issue while setting the values of "Limit" in a query,Limit is only showing "limit NULL"

Here is the snippet of my code.

SELECT block.loc, owner.name , block.dist_name FROM   house INNER JOIN block ON house.block_id = block.block_id INNER JOIN owner ON owner.house_id = house.house_id WHERE 
            block.dist = ? AND house.status = 5 limit ? , ? 
 $result = $this->db->query($qry, array($this->getDist(), (int) $this->getLimitStart(), (int) $this->getLimitOffset()));

dump for

(int) $this->getLimitStart() is '0' and (int) $this->getLimitOffset() is '10'
  • 写回答

3条回答 默认 最新

  • duanqian3953 2012-06-23 05:39
    关注

    As I understand that you make your own getter setter of the object, the getter which u are providing in you query, is returning NULL is only because you are not using the same setter.

    For Example: if You use it ($this->getLimitOffset()) you have to set it also like this yourObject->setLimitOffset(10). I think it will work for you now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?