Closed lanyizi closed 3 years ago
I remember having this issue a while back. I hope this bug gets fixed, but I solved it by just using underscores.
Oh thank you, this had me digging for errors for hours now. I hate using underscores but it works now... this issue is still present as of today (2020-01-22, v 1.7.8)
just realized it's not only table-names but also column-names with "-" that cause problems.
When containing hyphens (
-
), sometimes table names cannot be properly quoted by thetableQuote($table)
method because they (table names) are not even being matched by the previouspreg_match()
.Information
Detail Code The following code
Produces
Expected output
At line 1062 of Medoo.php, I see there is a
preg_match()
matching table name with[a-zA-Z0-9_]+
. By adding a hyphen there ([a-zA-Z0-9_-]+
), it will output a correct table name in the join statement. But I'm not sure how many else places need to be updated, and I'm also unsure if this would bring any side effects. Otherwise I could already make a pull request.