Closed weizengreal closed 7 years ago
see https://github.com/catfan/Medoo/issues/508
tannu13 commented on 14 Dec 2016
Yeah that is a drag, running it via Command Line, though you can run below command
SET SQL_MODE = ANSI_QUOTES
Think, this changes (for the session) your default quotes and the query works :)
This is the problem have been discussed too many times. Please search before adding issue.
Medoo configured using standard SQL (SQL-92) on initialization for being compatible with other database. Double quote for table and column name is a part of SQL-92 standard.
my code: $con->debug()->select('comment',array( '[><]user'=>['user.unionid'=>'comment.unionid'], ),'*',array( 'comment.unionid'=>"$unionid", 'cid'=>$comid ));
console echo : SELECT * FROM "club_comment" INNER JOIN "club_user" ON "club_user"."unionid" = "club_user"."comment.unionid" WHERE "club_comment"."unionid" = 'oV6UzwbnhiqLe_SYmnIZm9ykCSXM' AND "cid" = '227'
sql return : 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 '"club_comment" INNER JOIN "club_user" ON "club_user"."unionid" = "club_user"."co' at line 1
Why are data tables and field names not used "`"