I'm trying to write a query in CodeIgnitor and am a little stuck.
What I want to do is set up a variable. The variable is either equal to $_GET['var'] or it is equal to anything
So when the query runs it will either thry to match the var in that field or it will return anything from that field if it has an entry or if it is empty.
if (!empty($_GET['interface'])) { $interface = $_GET['interface']; } else { $interface = ' NULL OR NOT NULL'; }$query ->-> from('exp_channel_data t1') -> where('t1.entry_id', $related_id) -> where('t1.field_id_4911', $interface)