db_table_exists

bool db_table_exists (string tablename)

Checks for the existence of a table in the current database.

Arguments

tablename is the name of the table to be looked for.

Result

Returns TRUE if the table exists, FALSE otherwise.

Example

// Check for table

if(db_table_exists("mytable")) {
    echo "mytable exists";
}

 

See also

Database functions
Database support