-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Recently comitted rawAddPrefix() breaks queries #928
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Another issue - same result, but a quick fix could be to replace the function with below suggestion to bypass the problem. The function assumes that all queries are applied on tables and that the 'list' call has a result. However in your case you may want to look at the use of the ` in your statements - below regex fixes that issue too. Either way the $table variable is null (empty) in both cases. BE AWARE ... This is not fully tested! So, use the applied changes to fit your needs. function rawAddPrefix($query,$prefix){ |
Grrr ... I noticed that my test functions are a bit muddled up by github's editor. Here's the 'what to do to fix it' and use it in the class. insert this line to skip the regex function when there's no prefix insert this line after the 'list' function to check if there were any table names to prefix or not to prevent the $table[0] error Change the REGEX to include your backtick [sets to now include; single quote, tick and backtick] Hope it helps |
The
|
…d issues (#995, #967, #928) This commit fixes the "Undefined offset: 0" error that occurred in the rawAddPrefix function when using backtick delimiters for table names in SQL queries. It also addresses issues reported in tickets #995, #967, and #928, which were likely related to the same underlying problem with table name identification. Changes: Updated the regular expression in rawAddPrefix to match backtick characters (\) as valid delimiters for table names. This fix ensures that the function correctly identifies and prefixes table names regardless of the delimiter used.
PHP-MySQLi-Database-Class/MysqliDb.php
Line 559 in db3f585
Undefined offset: 0
notice. What's the intent of the function, @bejutassle ? Would you kinly look into fixing it?The text was updated successfully, but these errors were encountered: