* Fix rank importing with PIREP pay #443 * Import ledger information #443 * Uncomment out testing importers * Import expense log and settings #443 * Formatting
This commit is contained in:
@@ -85,6 +85,27 @@ class ImporterDB
|
||||
return $table;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does a table exist? Try to get the column information on it.
|
||||
* The result will be 'false' if that table isn't there
|
||||
*
|
||||
* @param $table
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function tableExists($table): bool
|
||||
{
|
||||
$this->connect();
|
||||
|
||||
$sql = 'SHOW COLUMNS FROM '.$this->tableName($table);
|
||||
$result = $this->conn->query($sql);
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the names of the columns for a particular table
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user