Ticket #14273: maybe_create_table.diff
| File maybe_create_table.diff, 968 bytes (added by , 16 years ago) |
|---|
-
install-helper.php
65 65 */ 66 66 function maybe_create_table($table_name, $create_ddl) { 67 67 global $wpdb; 68 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 69 if ($table == $table_name) { 70 return true; 71 } 68 $clean_table_name = $wpdb->escape($table_name); 69 if(strtolower($wpdb->get_var("SHOW TABLES LIKE '$clean_table_name'")) == strtolower($table_name)) { 70 return true; 72 71 } 73 // didn't find it try to create it.72 // didn't find it try to create it. 74 73 $wpdb->query($create_ddl); 75 74 // we cannot directly tell that whether this succeeded! 76 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 77 if ($table == $table_name) { 78 return true; 79 } 80 } 81 return false; 75 return strtolower($wpdb->get_var("SHOW TABLES LIKE '$clean_table_name'")) == strtolower($table_name); 82 76 } 83 77 endif; 84 78
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)