optimizing sqlite driver to look for the "From" keyword in reverse order on the sql string

This commit is contained in:
José Lorenzo Rodríguez 2011-01-04 17:44:33 -04:30
parent 4948280ba8
commit 2b9c6b8609

View file

@ -284,7 +284,7 @@ class DboSqlite extends DboSource {
// so try to figure it out based on the querystring // so try to figure it out based on the querystring
$querystring = $results->queryString; $querystring = $results->queryString;
if (stripos($querystring, 'SELECT') === 0) { if (stripos($querystring, 'SELECT') === 0) {
$last = stripos($querystring, 'FROM'); $last = strripos($querystring, 'FROM');
if ($last !== false) { if ($last !== false) {
$selectpart = substr($querystring, 7, $last - 8); $selectpart = substr($querystring, 7, $last - 8);
$selects = explode(',', $selectpart); $selects = explode(',', $selectpart);