nahid / talk

Talk is a real-time users messaging and chatting system for Laravel.
MIT License
1.61k stars 327 forks source link

QueryException in Connection.php line 662: #17

Closed rrajesh145 closed 8 years ago

rrajesh145 commented 8 years ago

I am getting below error invoking getInbox() method in my Laravel application , Can you please suggest a fix .

QueryException in Connection.php line 662: SQLSTATE[HY000]: General error: 2031 (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 = :user
OR conv.user_two = :user
) and (msg.created_at)
in (
SELECT max(msg.created_at) as created_at
FROM conversations conv, messages msg
WHERE CASE
WHEN conv.user_one = :user
THEN conv.user_two = user.id
WHEN conv.user_two = :user
THEN conv.user_one = user.id
END
AND conv.id = msg.conversation_id
AND (
conv.user_one = :user
OR conv.user_two = :user
)
GROUP BY conv.id
)
ORDER BY msg.created_at DESC
LIMIT :offset, :take)
nahid commented 8 years ago

@rrajesh145 please share your code. I just check now with fresh installation. Its worked fine

rrajesh145 commented 8 years ago

@nahid . Below is the code i used in method of controller

$user=\Auth::user();
$this->talk->setAuthUserId($this->user->id);
$this->talk->getInbox();

It seems that this issue was fixed in latest commit . But when i use composer update command . nahid/talk is not getting updated in my project.

nahid commented 8 years ago

Please remove it first and then install again

rrajesh145 commented 8 years ago

It works now . But Why composer update is failing to update the latest code ?

nahid commented 8 years ago

Is it show any error message when composer update?

rrajesh145 commented 8 years ago

It doesn't shows neither error message nor new package installed message