.tables only works with the SQLite3 CLI program
http://www.sqlite.org/faq.html#q7
This commit is contained in:
parent
b1ec0c434e
commit
05cfbde372
@ -689,6 +689,7 @@ class Database {
|
|||||||
* @return int|null
|
* @return int|null
|
||||||
*/
|
*/
|
||||||
public function count_tables() {
|
public function count_tables() {
|
||||||
|
|
||||||
if(is_null($this->db) || is_null($this->engine)) $this->connect_db();
|
if(is_null($this->db) || is_null($this->engine)) $this->connect_db();
|
||||||
|
|
||||||
if($this->engine->name === "mysql") {
|
if($this->engine->name === "mysql") {
|
||||||
@ -701,7 +702,7 @@ class Database {
|
|||||||
);
|
);
|
||||||
} else if ($this->engine->name === "sqlite") {
|
} else if ($this->engine->name === "sqlite") {
|
||||||
return count(
|
return count(
|
||||||
$this->get_all(".tables")
|
$this->get_all("SELECT name FROM sqlite_master WHERE type = 'table'")
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Hard to find a universal way to do this...
|
// Hard to find a universal way to do this...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user