0

Something like this:

$connection->executeQuery('check table historial1 in database $connection->executeQuery('show tables')')
dur
  • 15,689
  • 25
  • 79
  • 125
  • Check this: https://stackoverflow.com/questions/1717495/check-if-a-database-table-exists-using-php-pdo – MD Ruhul Amin Jun 06 '17 at 06:00
  • 1
    Possible duplicate of [Check if a database table exists using PHP/PDO](https://stackoverflow.com/questions/1717495/check-if-a-database-table-exists-using-php-pdo) – MD Ruhul Amin Jun 06 '17 at 06:01

1 Answers1

0
 $sql = "SHOW TABLES 'Table_Name' ";
    if($this->is_connected)
    {
        $query = $this->pdo->query($sql);
        return $query->fetchAll(PDO::FETCH_COLUMN);
    }
    return FALSE;
Sanjun Dev
  • 518
  • 8
  • 20
  • While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. – Badacadabra Jun 06 '17 at 16:01