function maybe_create_table($table_name, $create_ddl) {
global $wpdb;
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
function maybe_create_table($table_name, $create_ddl) {
global $wpdb;
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
if ($table == $table_name) {
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
if ($table == $table_name) {
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb, $debug;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb, $debug;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
//found it try to drop it.
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
//found it try to drop it.
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {