Skip to content
Advertisement

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘gelecek_üyeliği_sistemi.action_users, users’ doesn’t exist

I need to get these data from action_users table I have write a query in Mysql and it works fine but when I am trying to Convert SQL Statement into Laravel Eloquent i got this error

i am using laravel 8

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘gelecek_üyeliği_sistemi.action_users,users’ doesn’t exist (SQL: select users.name, users.email, sum(action_users.point) from action_users,users where users.id = action_users.user_id group by users)

here is my query in mysql and works fine in mysql

JavaScript

here is my same query in the controller

JavaScript

here is action_users migration

JavaScript

Advertisement

Answer

your query must be changed using join and you must remove users in the first line of query:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement