Giter Site home page Giter Site logo

Error on selecting conversation about chat HOT 15 CLOSED

musonza avatar musonza commented on May 19, 2024
Error on selecting conversation

from chat.

Comments (15)

Martin-Ha avatar Martin-Ha commented on May 19, 2024

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.

musonza avatar musonza commented on May 19, 2024

@lloricode What version of MariaDB do you have? The issue maybe the support for JSON columns.

from chat.

musonza avatar musonza commented on May 19, 2024

@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.

Martin-Ha avatar Martin-Ha commented on May 19, 2024

@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.

Martin-Ha avatar Martin-Ha commented on May 19, 2024

@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 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 7.1.9-1+ubuntu16.04.1+deb.sury.org+1

from chat.

tolgatasci avatar tolgatasci commented on May 19, 2024

look '>'$."message_id"'
problem '$."

"$message_id"

from chat.

musonza avatar musonza commented on May 19, 2024

@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.

Martin-Ha avatar Martin-Ha commented on May 19, 2024

@musonza Basically this:

    $count = 0;
    
    $conversations = Chat::conversations()->for($this->user)->get();
    foreach ($conversations as $conversation)
    {
      $count += $conversation->messages()->count();
    }
    
    return $count;

from chat.

musonza avatar musonza commented on May 19, 2024

@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.

lloricode avatar lloricode commented on May 19, 2024

@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.

lloricode avatar lloricode commented on May 19, 2024

hI! @musonza, this is where the code occurred an error.

https://github.com/lloricode/e-ttendance-laravel/blob/master/app/Repositories/Backend/ChatRepository.php#L46

from chat.

musonza avatar musonza commented on May 19, 2024

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.

lloricode avatar lloricode commented on May 19, 2024

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.

lloricode avatar lloricode commented on May 19, 2024

hmm btw thanks :)

best regard @musonza

from chat.

lloricode avatar lloricode commented on May 19, 2024

@musonza

they just got replay, they used version 4.7.0

from chat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.