Hello , I have an error when calling the getInbox() method (use laravel 5.3):
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'OR conv.user_two =
) and (msg.created_at)
in (
SELEC' at line 6 (SQL: SELECT user.id as receiver_id, user.name, msg.user_id as sender_id, conv.id as conv_id, msg.message, msg.created_at, msg.is_seen
FROM users user, conversations conv, messages msg
WHERE conv.id = msg.conversation_id
AND (
conv.user_one =
OR conv.user_two =
) and (msg.created_at)
in (
SELECT max(msg.created_at) as created_at
FROM conversations conv, messages msg
WHERE CASE
WHEN conv.user_one =
THEN conv.user_two = user.id
WHEN conv.user_two =
THEN conv.user_one = user.id
END
AND conv.id = msg.conversation_id
AND (
conv.user_one =
OR conv.user_two =
)
AND (
(
msg.user_id =
AND
msg.deleted_from_sender = 0
) OR (
msg.user_id !=
AND
msg.deleted_from_receiver = 0
)
)
GROUP BY conv.id
)
ORDER BY msg.created_at DESC
LIMIT 0, 20)
Hello , I have an error when calling the getInbox() method (use laravel 5.3):
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'OR conv.user_two = ) and (msg.created_at) in ( SELEC' at line 6 (SQL: SELECT user.id as receiver_id, user.name, msg.user_id as sender_id, conv.id as conv_id, msg.message, msg.created_at, msg.is_seen FROM users user, conversations conv, messages msg WHERE conv.id = msg.conversation_id AND ( conv.user_one = OR conv.user_two = ) and (msg.created_at) in ( SELECT max(msg.created_at) as created_at FROM conversations conv, messages msg WHERE CASE WHEN conv.user_one = THEN conv.user_two = user.id WHEN conv.user_two = THEN conv.user_one = user.id END AND conv.id = msg.conversation_id AND ( conv.user_one = OR conv.user_two = ) AND ( ( msg.user_id = AND msg.deleted_from_sender = 0 ) OR ( msg.user_id != AND msg.deleted_from_receiver = 0 ) ) GROUP BY conv.id ) ORDER BY msg.created_at DESC LIMIT 0, 20)