Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
973432436 opened this issue Jan 26, 2024 · 1 comment
Open

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

973432436 opened this issue Jan 26, 2024 · 1 comment

Comments

@973432436
Copy link

973432436 commented Jan 26, 2024

<?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

@jamieburchell
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants