When I do the following query as a DB:select
DB:raw
query against MySQL in Laravel 4 it returns no results. (Note, I've truncated the actual query for this example.)
SELECT user_id, email, first_name, last_name, photo_small
FROM users AS u
JOIN profiles AS p ON p.user_id = u.id
WHERE email IN (?) ....
where $p= "email.address1@com","xyz.xxx@.edu" and $p is the parameter
Yet when I do the following
SELECT user_id, email, first_name, last_name, photo_small
FROM users AS u
JOIN profiles AS p ON p.user_id = u.id
WHERE email IN ("email.address1@com","xyz.xxx@.edu") ....
I do get results.
I've confirmed the values of the parameters, checking the SQL and bindings with DB::getQueryLog()
and verified results using a separate db tool.
I would really like to avoid the unparameterized query for obvious reasons, but can't seem to get it to return anything even though it is valid SQL
Any suggestions would be welcome.