Wrong syntax for "joinSub" method in mysql driver #53894
Replies: 2 comments
-
We can just use the |
Beta Was this translation helpful? Give feedback.
-
Hi @allanmcarvalho,
That's the correct way.
You are using |
Beta Was this translation helpful? Give feedback.
-
Laravel Version
11.35.1
PHP Version
8.4|8.3
Database Driver & Version
MySQL 8.0.33 DBngin
Description
The error occurs in Laravel when executing a query that uses the joinSub method. Laravel generates invalid SQL syntax by adding parentheses around the table name in the INNER JOIN clause. Specifically, the SQL generated includes INNER JOIN (receipt_participants) instead of a valid reference to the table or subquery. MySQL does not support parentheses around a table name in this context, leading to the following syntax error:
Steps To Reproduce
Beta Was this translation helpful? Give feedback.
All reactions