Changeset 294 for trunk/wp-admin/wp-install-helper.php
- Timestamp:
- 08/05/2003 10:44:38 PM (23 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/wp-install-helper.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/wp-install-helper.php
r280 r294 1 1 <?php 2 2 require_once('../wp-config.php'); 3 $debug = 0; 3 4 4 5 /** … … 33 34 */ 34 35 function maybe_add_column($table_name, $column_name, $create_ddl) { 35 global $wpdb ;36 global $wpdb, $debug; 36 37 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 38 if ($debug) echo("checking $column == $column_name<br />"); 37 39 if ($column == $column_name) { 38 40 return true; … … 91 93 */ 92 94 function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { 93 global $wpdb ;95 global $wpdb, $debug; 94 96 $diffs = 0; 95 97 $results = $wpdb->get_results("DESC $table_name"); 96 98 97 99 foreach ($results as $row ) { 98 //print_r($row);100 if ($debug > 1) print_r($row); 99 101 if ($row->Field == $col_name) { 100 102 // got our column, check the params 101 //echo ("checking $row->Type against $col_type\n");103 if ($debug) echo ("checking $row->Type against $col_type\n"); 102 104 if (($col_type != null) && ($row->Type != $col_type)) { 103 105 ++$diffs; … … 116 118 } 117 119 if ($diffs > 0) { 118 //echo ("diffs = $diffs returning false\n");120 if ($debug) echo ("diffs = $diffs returning false\n"); 119 121 return false; 120 122 }
Note: See TracChangeset
for help on using the changeset viewer.