Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAW QUERY DELETE JOIN Prefix Table #1052

Open
BrainStormDevel opened this issue Jul 4, 2022 · 0 comments
Open

RAW QUERY DELETE JOIN Prefix Table #1052

BrainStormDevel opened this issue Jul 4, 2022 · 0 comments

Comments

@BrainStormDevel
Copy link

Information

  • Version of Medoo: 2.1.7
  • Version of PHP: 8.1
  • Type of Database (MySQL, MSSQL, SQLite...): MariaDB
  • System (Liunx|Windows|Mac): Windows/Linux

Raw query doesn't recognize the

tag after DELETE and before FROM. Here an example:

$db->debug()->query("DELETE <table1>,<table2>,<table3> FROM <table1> LEFT JOIN <table2> ON (<table1>.<id> = <table2>.<fid>) LEFT JOIN <table3> ON (<table2>.<pid> = <table3>.<id>) WHERE <table1>.<id> = :id", [
	":id" => 1
]);

Expected output:
DELETE prefix_table1,prefix_table2,prefix_table3 FROM prefix_table1 LEFT JOIN prefix_table2 ON (prefix_table1.id = prefix_table2.fid) LEFT JOIN prefix_table3 ON (prefix_table2.pid = prefix_table3.id) WHERE prefix_table1.id = '1'

Actual output:
DELETE table1,table2,table3 FROM prefix_table1 LEFT JOIN prefix_table2 ON (table1.id = table2.fid) LEFT JOIN prefix_table3 ON (table2.pid = table3.id) WHERE table1.id = '1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant