public function table_exists($table) {

        // if table argument contains the database name, extract it
        if (strpos($table, '.') !== false) list($database, $table) = explode('.', $table);

        // check if table exists in the database
        return is_array($this->fetch_assoc($this->query('SHOW TABLES' . (isset($database) ? ' IN ' . $database : '') . ' LIKE ?', array($table))));

    }
public function table_exists($table) {

        // if table argument contains the database name, extract it
        if (strpos($table, '.') !== false) list($database, $table) = explode('.', $table);

        // check if table exists in the database
        return is_array($this->fetch_assoc($this->query('SHOW TABLES' . (isset($database) ? ' IN ' . $database : '') . ' LIKE ?', array($table))));

    }
public function table_exists ( $ table ) { // if table argument contains the database name, extract it if ( strpos ( $ table , '.' ) !== false ) list ( $ database , $ table ) = explode ( '.' , $ table ) ; // check if table exists in the database return is_array ( $ this -> fetch_assoc ( $ this -> query ( 'SHOW TABLES' . ( isset ( $ database ) ? ' IN ' . $ database : '' ) . ' LIKE ?' , array ( $ table ) ) ) ) ; }
Checks whether a table exists in the current database.

<code>
// checks whether table "users" exists
table_exists('users');
</code>

@param  string  $table      The name of the table to check if it exists in the database.

<i>May also be given like databasename.tablename if a database was not explicitly
selected with the {@link connect()} or {@link select_database()} methods prior to
calling this method.</i>

@since  2.3

@return boolean             Returns TRUE if table given as argument exists in the database or FALSE if not.
Checks whether a table exists in the current database .