Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14346

Using db->like() breaks when using single quotes?

$
0
0
Hi,

I am creating a simple search for a book name. When I use:

$book_name = "John's Apples";

$this->db->like("books.name", $book_name)->get("books");

The query fails to find any results. I tried outputting the query using $this->db->last_query() and it doesn't really show the ' being escaped. Is this a bug? Should I be handling Like data differently?

Viewing all articles
Browse latest Browse all 14346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>