Comments (15)
Same error here, I get two error messages:
(1/2) PDOExceptionSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>'$."message_id"' = `mc_messages`.`id` where `mc_messages`.`conversation_id` in '
in /vendor/laravel/framework/src/Illuminate/Database/Connection.php line 319
(2/2) QueryExceptionSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>'$."message_id"' = `mc_messages`.`id` where `mc_messages`.`conversation_id` in ' at line 1 (SQL: select `notifications`.*, `mc_messages`.* from `mc_messages` inner join `notifications` on `notifications`.`data`->'$."message_id"' = `mc_messages`.`id` where `mc_messages`.`conversation_id` in (1) order by `mc_messages`.`id` desc)
in /vendor/laravel/framework/src/Illuminate/Database/Connection.php (line 647)
from chat.
@lloricode What version of MariaDB do you have? The issue maybe the support for JSON columns.
from chat.
@Martin-Ha What type of database are you using. You may also have an issue with JSON columns. You can however use an older version of the package if the issue is not resolved soon. https://github.com/musonza/chat/tree/1.0
from chat.
@musonza Here's my config via phpmyadmin:
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.5.47-0+deb8u1 - (Debian)
Protocol version: 10
Server charset: UTF-8 Unicode (utf8)
Web server
Apache/2.4.10 (Debian)
Database client version: libmysql - 5.5.47
from chat.
@musonza Also, here's the config I have on development machine where it works flawlessly (homestead):
Database server
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.7.17-0ubuntu0.16.04.2 - (Ubuntu)
Protocol version: 10
User: homestead@localhost
Server charset: UTF-8 Unicode (utf8)
nginx/1.11.9
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 -
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 7.1.9-1+ubuntu16.04.1+deb.sury.org+1
from chat.
look '>'$."message_id"'
problem '$."
"$message_id"
from chat.
@Martin-Ha @tolgatasci I will do a few tests later on today and also look at lloricode/e-ttendance-laravel to recreate the issue. Otherwise if you have a fix you can create a pull request. Can you show me a snippet of code that you are running to select the conversation etc?
from chat.
@musonza Basically this:
$count = 0;
$conversations = Chat::conversations()->for($this->user)->get();
foreach ($conversations as $conversation)
{
$count += $conversation->messages()->count();
}
return $count;
from chat.
@Martin-Ha It works on the other environment because you are using at least MySQL 5.7 which supports JSON columns but on the other environment it looks like you are using MySQL 5.5
https://dev.mysql.com/doc/refman/5.7/en/json.html
from chat.
@musonza thanks response, the problem is on the xampp user.. while on mine looks great no issue im using msql-workbench. the other user who create issue on my repo has a prblem they using xampp on windows.
from chat.
hI! @musonza, this is where the code occurred an error.
from chat.
Yes the package uses laravel notifications which takes advantage of the Json columns. Can you verify the version of MySQL being used is 5.5 whereever you get the error? Xampp or workbench etc shouldn't matter
I will/may however add capability to use custom notifications like I had in the version 1 of the chat package for users with older MySQL versions
from chat.
sorry for a long replay, I ask the other user but did not replay, they just install work-bench without any know what is the version of mysql in their issue,
from chat.
hmm btw thanks :)
best regard @musonza
from chat.
they just got replay, they used version 4.7.0
from chat.
Related Issues (20)
- Dependency issue in Laravel Framework 5.8.38 HOT 2
- Conversation with hundreds of participants cause error on mass insert: Prepared statement contains too many placeholders HOT 11
- any way to query specific types of messages HOT 2
- Additional field in chat_message model HOT 5
- Get all messages for a user
- Call to a member function only() on null error HOT 1
- Error Call to undefined method Musonza\Chat\Services\MessageService::data() HOT 1
- Customize broadcast queue and connection in config
- A way of including all participation message_notifications
- Laravel 9 Support HOT 9
- Get all participant Models that a Model ever had a conversation with
- Method ConversationService::common() does not exist HOT 1
- $conversation = Chat::conversations()->between($participantModel1, $participantModel2); is not work HOT 2
- how to get conversations with unreadCount HOT 1
- make sure you get conversations that are direct, and make sure direct_message column is 1.
- Attempted to lazy load [participation] on model [Musonza\Chat\Models\Message] but lazy loading is disabled.
- The conversation's method 'between' is not giving the correct count
- Chat/messaging
- how to specify columns in chat participants HOT 1
- Participation always returns the first one regardless of the assigned conversation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chat.