SELECT m.id, m.title, m.message, m.from, m.to2, m.to_viewed, m.from_viewed, m.created, u.username
FROM tbl_messages m
INNER JOIN tbl_users u
ON m.from = u.id WHERE m.to2 = '1' && m.to_saved = '1' && m.to_deleted = '0'
ORDER BY m.created DESC
Having removed m.from
, the query runs. It doesn't like this field name.
Is 'from' reserved?
Could someone suggest a fix?
Thanks
Yes, it's one of the reserved words. Use backticks to quote it:
m.`from`
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