maybe_create_table

The timeline below displays how wordpress function maybe_create_table has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.3

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database table and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.3

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database table and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database table and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.4

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database table and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database table and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.1

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.4

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database table and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.4

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database table and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.4

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.2

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.2

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.1

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.1

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.5

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.2

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
    $wpdb->query($create_ddl);
    // We cannot directly tell whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.6

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.1

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.9

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.8

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.7

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.6

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.6

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.2

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.9

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.9

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.8

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.7

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.6

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.5

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.8

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.8

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.9

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.9

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.8

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.7

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.6

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.6

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.5

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.2

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.2

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.1

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.1

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.7

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.9

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.8

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.7

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.6

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.6

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.2

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.6

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.9

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.9

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.8

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.8

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.7

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.6

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.4

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.3

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database, if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) === $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.5

/**
 * Creates a table in the database if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl SQL statement to create table.
 * @return bool True on success or if the table already exists. False on failure.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table === $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.9

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.9

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.8

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.8

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.7

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.7

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.6

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.2

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.1

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.4

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.4

//
// General functions we use to actually do stuff.
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.9

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.9

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.9

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.9

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.9

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col('SHOW TABLES', 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .19

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.0

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .25

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .24

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .24

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .23

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .21

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .20

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .28

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .27

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 6.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .19

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .19

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 6.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.9

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .30

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .29

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .28

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .27

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .26

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .21

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .20

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 5.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 5.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .32

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .32

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .31

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .30

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .30

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .29

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .29

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .28

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .27

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .26

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.8

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.6

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.4

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .33

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .33

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .32

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .30

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .29

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .29

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .28

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .28

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .27

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .26

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .20

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .19

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.1

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @global wpdb  $wpdb
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.7

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.5

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .37

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .36

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .36

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .35

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .35

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .34

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .33

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .32

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .32

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .30

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.3

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .29

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .29

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .28

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .27

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 2.2

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .19

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

//
// General functions we use to actually do stuff
//
/**
 * Creates a table in the database if it doesn't already exist.
 *
 * This method checks for an existing database and creates a new one if it's not
 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
 * to query all tables first and then run the SQL statement creating the table.
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 2.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.6

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .40

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .40

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .39

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .39

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .38

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .37

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .36

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .35

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .35

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .34

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .33

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .33

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .32

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .32

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .30

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .30

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .29

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .29

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .28

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .27

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .27

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .23

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .22

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 1.1

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 1.1

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.1

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.1

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.7

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.7

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.6

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.6

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.5

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .38

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .38

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .37

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .37

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .36

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .35

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .34

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .33

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .32

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .31

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .30

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 0.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .29

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .28

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .27

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .25

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .24

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 0.1

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_name));
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    // Didn't find it try to create it..
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    if ($wpdb->get_var($query) == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 4.0

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 4.0

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    // Didn't find it, so try to create it.
    $wpdb->query($create_ddl);
    // We cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.8

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.8

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.7

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.5

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.5

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.4

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 9.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.3

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .10

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 9.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 *
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.9

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.9

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.9

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.6

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .39

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .39

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .38

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .38

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .37

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .37

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .36

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .36

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .35

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .34

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .33

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .32

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .32

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .30

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .30

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.3

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .29

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .28

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .28

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .27

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .26

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .25

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .25

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .24

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .21

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .20

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 8.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .18

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .17

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .11

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 8.1

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 3.8

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.8

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.9

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.8

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.7

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.6

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.5

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .41

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .40

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .40

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.4

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .39

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .38

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .38

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .37

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .36

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .35

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .34

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .34

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .33

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .32

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .31

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .31

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .30

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: 7.3

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.3

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .29

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .29

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .28

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .28

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .27

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .27

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .26

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .25

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .24

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .23

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .22

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .22

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .21

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .21

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .20

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.2

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .19

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .18

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .17

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .16

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .15

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .14

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .13

/**
 * Create database table, if it doesn't already exist.
 *
 * @since 1.0.0
 * @package WordPress
 * @subpackage Plugin
 * @uses $wpdb
 *
 * @param string $table_name Database table name.
 * @param string $create_ddl Create database table SQL.
 * @return bool False on error, true if already exists or success.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    //didn't find it try to create it.
    $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    foreach ($wpdb->get_col("SHOW TABLES", 0) as $table) {
        if ($table == $table_name) {
            return true;
        }
    }
    return false;
}

WordPress Version: .12

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .12

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .11

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: .10

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.1

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 7.1

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.7

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}

WordPress Version: 3.7

// The functions we use to actually do stuff
// General
/**
 * {@internal Missing Short Description}}
 *
 * {@internal Missing Long Description}}
 *
 * @since 1.0.0
 *
 * @param string $table_name Database table name to create.
 * @param string $create_ddl SQL statement to create table.
 * @return bool If table already exists or was created by function.
 */
function maybe_create_table($table_name, $create_ddl)
{
    global $wpdb;
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    //didn't find it try to create it.
    $q = $wpdb->query($create_ddl);
    // we cannot directly tell that whether this succeeded!
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
        return true;
    }
    return false;
}