Skip to content

bug: codeigniter3 db->or_where_not_in(...) #6262

Open

Description

@likun-mci
<?php
class Test{

	public function abc(){
		$errLinks = $this->db
					->where( 'article_id', 240105 )
					->group_start()
						->where_not_in( 'link_url', [ 'https://test.com/battery/' ] )
						->or_where_not_in( 'link_keyword', [ 'difference between test abc and lithium battery', 'difference between test cde and lithium battery' ] )
					->group_end()
					->get( 'TestDB' )->result_array();
		print_r( [ $errLinks, $this->db->last_query() ] );
	}

}
?>

image

Activity

  1. jamieburchell commented on Jan 26, 2024

    @jamieburchell
    Contributor

    This is due to the automatic escaping. You'd need to turn it off and escape the values manually.

    ->or_where_not_in( 'link_keyword', [ '\'difference between test abc and lithium battery\'', '\'difference between test cde and lithium battery\'' ], FALSE )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions