gpt4 book ai didi

php - mysql like 查询带来其他字母结果

转载 作者:行者123 更新时间:2023-11-29 02:25:40 25 4
gpt4 key购买 nike

我正在使用 codeigniter 事件记录从数据库中获取所有“s”页面,所有字母显示都没有任何问题。

但是当我们获取's'的结果时。它也提供所有其他 'j'、'b' 结果,它只与 s 字母表相冲突。

SELECT * FROM (`ci_pages`) WHERE `cat_id` = '1' AND `page_stitle` LIKE 's%'

$this->db->select('*');
$this->db->from('ci_page');
$this->db->where('cat_id', $cat_id);
$this->db->like('page_stitle', $list, 'after');

上面给定的查询带来了所有 s 结果,但混合了其他字母结果。

最佳答案

改变你的点赞方式,

$this->db->like('page_stitle', $pagetitle, 'after');

其中 $pagetitle 包含 like 方法的值。

关于php - mysql like 查询带来其他字母结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22474176/

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