combining mysql AND OR queries in Codeigniter

前端 未结 9 1474
慢半拍i
慢半拍i 2020-12-09 07:35

I want to combine AND OR mysql queries in CI. I have already seen this thread: http://codeigniter.com/forums/viewthread/92818/. But they don\'t provide the exact solution th

9条回答
  •  既然无缘
    2020-12-09 08:21

    The query itself doesn't make sense, you're selecting:

    • Tove Svendson, age 12
    • Ola Svendsen, age 12
    • any male named Svendson, age 12
    • any person from India named Svendson, age 12

    Tove seems like a man's name, so selecting the gender is unnecessary. Ola seems like a girl's name, so selecting the gender is not only unnecessary, but it just doesn't make sense. Your query will return any 12 year old male named Svendson, any 12 year old from India named Svenson, and Tove and Ola Svendson, IF they're 12 years old.

    Why don't you want to put it between () brackets? Do you want to accomplish it with active record for some reason?

提交回复
热议问题