Closed theveloperspl closed 3 years ago
The main purpose of a wrapper is to avoid Raw SQL query.
yeah, I managed to do this by built in functions
Query below produces warning stated in issue title: $db->rawQuery("SELECT user, usd_value, date, method FROM
deposits
ORDER BYid
DESC LIMIT 5"); Warning is: Notice: Undefined offset: 0 in C:\xampp\htdocs\investor\vendor\thingengineer\mysqli-database-class\MysqliDb.php on line 559The warning is thrown but the query is successful and returns correct data. Any idea on fixing this?
edit method rawAddprefix() in file mysqlidb.php public function rawAddPrefix($query){ $query = str_replace(PHP_EOL, '', $query); $query = preg_replace('/\s+/', ' ', $query); preg_matchall("/(from|into|update|join|describe) [\'\´]?([a-zA-Z0-9-]+)[\'\´]?/i", $query, $matches); $_from_table=$_from=$_table=''; list($from_table, $from, $table) = $matches; if (isset($table[0])) { $_table=$table[0]; } return str_replace($_table, self::$prefix.$_table, $query); }
Query below produces warning stated in issue title: $db->rawQuery("SELECT user, usd_value, date, method FROM
deposits
ORDER BYid
DESC LIMIT 5"); Warning is: Notice: Undefined offset: 0 in C:\xampp\htdocs\investor\vendor\thingengineer\mysqli-database-class\MysqliDb.php on line 559The warning is thrown but the query is successful and returns correct data. Any idea on fixing this?