method getTables documentation in bbn\Db\Languages\Sqlite
Return tables' names of a database as an array.
function(string $database = '')
{
if (!$this->check()) {
return null;
}
if (empty($database) || !bbn\Str::checkName($database)) {
$database = $this->getCurrent() === 'main' ? '' : '"'.$this->getCurrent().'".';
}
elseif ($database === 'main') {
$database = '';
}
$t2 = [];
if (($r = $this->rawQuery(
'
SELECT "tbl_name"
FROM '.$database.'"sqlite_master"
WHERE type = \'table\''
) )
&& $t1 = $this->fetchAllResults($r, \PDO::FETCH_NUM)
) {
foreach ($t1 as $t){
if (strpos($t[0], 'sqlite') !== 0) {
array_push($t2, $t[0]);
}
}
}
return $t2;
}
Return tables' names of a database as an array. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2024
BBN Solutions