简体   繁体   中英

Codeigniter uri->segment doesn't work in query

I'm passing some variables through the uri, I then collect them using $this->uri->segment(3) make an active record query using the value i collect. when one of the variable is a composed word such as "first_last" the query returns null even if i know the DB has such entry. If however it is a single word such as "first" the query works fine. Thank you for your help

I think it's because of the denied chars in the URL. See the config of CI and add "_" in the allowed char's regexp

将“ first_last”更改为“ first-last”也会导致下划线对网址的影响不佳,然后查看其是否有效;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM