【问题标题】:CodeIgniter Active Record: how to use "set" method with mysql functionsCodeIgniter Active Record:如何在 mysql 函数中使用“set”方法
【发布时间】:2011-06-23 11:00:29
【问题描述】:

我的查询是这样的

INSERT INTO tbl VALUES(UNHEX('some_value'));

如何使用 codeigniter 活动记录,特别是 '$this->db->set' 函数来取消此查询

this->db->set('password', $value); // How do I insert the mysql function here
$this->db->insert('tbl');

【问题讨论】:

    标签: codeigniter activerecord


    【解决方案1】:

    看看documentation - 它指出如果您需要一些未转义的值,您应该将 set() 中的第三个参数设置为 false。像这样:

    $this->db->set("password", "UNHEX('".$value."')", FALSE);
    

    【讨论】:

      猜你喜欢
      • 2015-06-24
      • 1970-01-01
      • 2016-08-23
      • 1970-01-01
      • 2017-03-30
      • 2011-07-16
      • 1970-01-01
      • 2012-03-31
      • 2013-04-11
      相关资源
      最近更新 更多