I'm trying to do a subquery with
$this->db->where(" EXISTS (SELECT * FROM myTable)");
But it doesnt work, the output of this is: myquery + WHERE 'EXISTS (SELECT * FROM myTable);
That quote before the EXISTS makes the query unresolvable!
Does anyone knows how to solve it?
please remove space before and after EXISTS keyword.that does not display any error.
$this->db->where("EXISTS(SELECT * FROM myTable)");
Maybe you could try to set the escape to false by using
$this->db->where(" EXISTS (SELECT * FROM myTable)", null, false);
This is the snippet of where() in DB_active_rec.php
public function where($key, $value = NULL, $escape = TRUE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With