Changeset 30542 for trunk/src/wp-admin/install-helper.php
- Timestamp:
- 11/24/2014 05:46:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/install-helper.php
r30122 r30542 11 11 * do, then it is advised to just write the SQL code yourself. 12 12 * 13 * <code>14 * check_column('wp_links', 'link_description', 'mediumtext');15 * if (check_column($wpdb->comments, 'comment_author', 'tinytext'))16 * echo "ok\n";13 * check_column( 'wp_links', 'link_description', 'mediumtext' ); 14 * if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) { 15 * echo "ok\n"; 16 * } 17 17 * 18 * $error_count = 0;19 * $tablename = $wpdb->links;20 * // check the column21 * if (!check_column($wpdb->links, 'link_description', 'varchar(255)')) {22 * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";23 * $q = $wpdb->query($ddl);24 * }18 * $error_count = 0; 19 * $tablename = $wpdb->links; 20 * // Check the column. 21 * if ( ! check_column($wpdb->links, 'link_description', 'varchar( 255 )' ) ) { 22 * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; 23 * $q = $wpdb->query( $ddl ); 24 * } 25 25 * 26 * if (check_column($wpdb->links, 'link_description', 'varchar(255)')) { 27 * $res .= $tablename . ' - ok <br />'; 28 * } else { 29 * $res .= 'There was a problem with ' . $tablename . '<br />'; 30 * ++$error_count; 31 * } 32 * </code> 26 * if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { 27 * $res .= $tablename . ' - ok <br />'; 28 * } else { 29 * $res .= 'There was a problem with ' . $tablename . '<br />'; 30 * ++$error_count; 31 * } 33 32 * 34 33 * @package WordPress
Note: See TracChangeset
for help on using the changeset viewer.