Can 'false' match some string in mysql?

前端 未结 4 643
夕颜
夕颜 2021-01-21 15:48

I have a table like this:

CREATE TABLE IF NOT EXISTS `session` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `token` varchar(32) NOT NULL,
  `profile` varchar(1000         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-21 16:20

    This should be a comment, but I don't have enough reputation... so..

    DelphiQin, you said in a comment that you are passing the result of the CI "get()" method to the query parameter. I've been there and I solved by just casting the variable to string before passing to the query:

    (string)$my_var
    

    This way, it will use '' (empty string) instead of boolean false.

    I hope it helps people with the same problem.

提交回复
热议问题