GapOrm/Drivers/PdoDriver.php
public function tableExists($tableName)
    {
        if (is_null($this->dbh)) {
            throw new NoConnectionException();
        }

        $mrSql  = "SHOW TABLES LIKE :table_name";
        $mrStmt = $this->dbh->prepare($mrSql);

        // protect from injection attacks
        $mrStmt->bindParam(":table_name", $tableName, \PDO::PARAM_STR);

        $sqlResult = $mrStmt->execute();

        if ($sqlResult) {
            $row = $mrStmt->fetch(\PDO::FETCH_NUM);

            if ($row[0]) {
                return true;
            }
        }

        return false;
    }
public function tableExists($tableName)
    {
        if (is_null($this->dbh)) {
            throw new NoConnectionException();
        }

        $mrSql  = "SHOW TABLES LIKE :table_name";
        $mrStmt = $this->dbh->prepare($mrSql);

        // protect from injection attacks
        $mrStmt->bindParam(":table_name", $tableName, \PDO::PARAM_STR);

        $sqlResult = $mrStmt->execute();

        if ($sqlResult) {
            $row = $mrStmt->fetch(\PDO::FETCH_NUM);

            if ($row[0]) {
                return true;
            }
        }

        return false;
    }
public function tableExists ( $ tableName ) { if ( is_null ( $ this -> dbh ) ) { throw new NoConnectionException ( ) ; } $ mrSql = "SHOW TABLES LIKE :table_name" ; $ mrStmt = $ this -> dbh -> prepare ( $ mrSql ) ; // protect from injection attacks $ mrStmt -> bindParam ( ":table_name" , $ tableName , \ PDO :: PARAM_STR ) ; $ sqlResult = $ mrStmt -> execute ( ) ; if ( $ sqlResult ) { $ row = $ mrStmt -> fetch ( \ PDO :: FETCH_NUM ) ; if ( $ row [ 0 ] ) { return true ; } } return false ; }
This function checks if the table exists in the passed PDO database connection

@param $tableName
@return boolean - true if table was found, false if not
@throws \GapOrm\Exceptions\NoConnectionException
This function checks if the table exists in the passed PDO database connection