One of my controllers takes an id field as $id
and I use it on a query. When I check the query string it passes the id as string value like this:
select `id`, `name` from `table` where `id` = '1'
If I pass the intval($id)
to the query it still works as expected.
select `id`, `name` from `table` where `id` = 1
My question: Which one is the optimized query and best practice? Thanks.