PHP-SQL-Parser
PHP-SQL-Parser copied to clipboard
"strpos(): Empty needle" warning when SQL query refers to a `help` table
hi,
when running this code example:
<?php
namespace PHPSQLParser;
require_once dirname(__FILE__) . '/../vendor/autoload.php';
$sql = 'SELECT * from help';
echo $sql . "\n";
try {
$parser = new PHPSQLParser($sql, true);
} catch (\Exception $e) {
echo "caught";
}
the following PHP warning is displayed:
Warning: strpos(): Empty needle in src/PHPSQLParser/positions/PositionCalculator.php on line 138
Ideally the library would be able to parse such a query since MySQL can.
Alternatively it would be nice to avoid the warning.