gpt4 book ai didi

php - 如何为以下查询创建 codeigniter 事件记录?

转载 作者:行者123 更新时间:2023-11-29 11:13:35 26 4
gpt4 key购买 nike

如何为以下查询创建 codeigniter 事件记录?

$query = $this->db->query("SELECT * FROM `student`JOIN `pay_log` ON 
`student`.`student_id` = `pay_log`.`student_id` WHERE (`activity` LIKE '%yr%'
OR `activity` LIKE '%yr1%') AND `class_id` = 'cl123' AND `student`.`status` = 'active'");

最佳答案

试试这个

      $query = $this->db
->select()
->from( 'student as s' )
->join( 'pay_log as p', 's.student_id = p.student_id' )
->where( 'activity LIKE "%yr%" OR activity LIKE "%yr1%"', FALSE )
->where( 'class_id', 'cl123' )
->where( 's.status', 'active' )
->get();

关于php - 如何为以下查询创建 codeigniter 事件记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40127243/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com