I can't figure this out, and no searching has yielded results.
the query:
$QUERY = "SELECT rp.perm_id
FROM ac_br_user-roles AS ur
JOIN ac_br_roles-permissions AS rp ON rp.role_id = ur.role_id
WHERE ur.user_id = ?";
I have tried using ``
backticks ''
single quotes and {}
curly braces to enclose the table name and \
backslash right at the - to escape the -
hyphen all to no avail.
The error:
PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "-" LINE 2: FROM ac_br_user-roles AS ur ^ in
or "at or near" whatever the escape character I try using on LINE 2
UPDATE
$QUERY = 'SELECT rp.perm_id
FROM `ac_br_user-roles` AS ur
JOIN `ac_br_roles-permissions` AS rp ON rp.role_id = ur.role_id
WHERE ur.user_id = ?';
PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "
" LINE 2: FROM
ac_br_user-roles` AS ur ^ in
backticks don't help, same results for both single and double quotes on the $QUERY string.