Skip to content
Advertisement

Codeigniter or_where_in

I am trying to combine these two queries in Codeigniter. So the row either has to have the user_id of $user eg 3 OR have an id matching the array $repost. I know how to do or_where but how do you do or_where_in?

Thanks

JavaScript

Advertisement

Answer

JavaScript

Syntax:

JavaScript

Parameters:

JavaScript

Returns:

JavaScript

Return type:

JavaScript

Generates a WHERE field IN(‘item’, ‘item’) SQL query, joined with ‘OR’ if appropriate.

More information here: https://codeigniter.com/userguide3/database/query_builder.html?highlight=or_where_in#CI_DB_query_builder::or_where_in

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement