Welcome Guest, Not a member yet? Register   Sign In
qb_where has 2 arrays of conditions value escape
#1

I believe what I have to is some kind of reset, clearout, free, new something, but, I have not found it yet.

I do a query and it works fine.

The I do another query and it combines the old where with the new where


in the CI_DB_mysqli_driver Object
.....
I have this
[qb_where:protected] => Array
        (
            [0] => Array
                (
                    [condition] => categories.id =
                    [value] => '13'
                    [escape] => 1
                )

            [1] => Array
                (
                    [condition] => AND (JL_posts.title LIKE '%nerve%' AND JL_posts.title LIKE '%entrapment%' OR  JL_posts.body LIKE '%nerve%' AND JL_posts.body LIKE '%entrapment%' )
                    [value] =>
                    [escape] => 1
                )

        )


If I delete the [1] => Array , I think I will be okay

What is the CI way of doing this

What I see is that the 2 arrays are combined in the next query

[10] => SELECT *

FROM `JL_posts`

INNER JOIN `JL_posts_categories` ON `JL_posts`.`id`=`JL_posts_categories`.`post_id`

INNER JOIN `JL_categories` ON `JL_posts_categories`.`category_id`=`JL_categories`.`id`

WHERE `JL_categories`.`id` = '13'

AND (`JL_posts`.`title` LIKE '%nerve%' AND `JL_posts`.`title` LIKE '%entrapment%' OR  `JL_posts`.`body` LIKE '%nerve%' AND `JL_posts`.`body` LIKE '%entrapment%' )
        )
Huh
I wrote my first program in 15 minutes. It took me 3 hours to keypunch it.

I wrote my first BASH script in 5 minutes. It took me a day to find out I had to put a . (period) in front of it to get it to execute.
Reply


Messages In This Thread
qb_where has 2 arrays of conditions value escape - by gmgj - 02-22-2020, 10:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB