Skip to content

reword prepere() error. Fix for tableExists. Bump for 2.6 release #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions MysqliDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @copyright Copyright (c) 2010
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License
* @link http://github.com/joshcam/PHP-MySQLi-Database-Class
* @version 2.6-master
* @version 2.6
*/

class MysqliDb
Expand Down Expand Up @@ -1493,7 +1493,7 @@ protected function _buildLimit($numRows)
protected function _prepareQuery()
{
if (!$stmt = $this->mysqli()->prepare($this->_query)) {
$msg = "Problem preparing query ($this->_query) " . $this->mysqli()->error;
$msg = $this->mysqli()->error . " query: " . $this->_query;
$this->reset();
throw new Exception($msg);
}
Expand Down Expand Up @@ -1868,11 +1868,10 @@ public function tableExists($tables)
return false;
}

array_walk($tables, function (&$value, $key) {
$value = self::$prefix . $value;
});
foreach ($tables as $i => $value)
$tables[$i] = self::$prefix . $value;
$this->where('table_schema', $this->db);
$this->where('table_name', $tables, 'IN');
$this->where('table_name', $tables, 'in');
$this->get('information_schema.tables', $count);
return $this->count == $count;
}
Expand Down