~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-admin/install-helper.php

  • Committer: Nick Moffitt
  • Date: 2015-01-15 11:04:26 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: nick.moffitt@canonical.com-20150115110426-5stm1p14cfnxrtme
New Upstream Version 4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * needing to use these functions a lot, you might experience time outs. If you
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";
17
 
 *
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
 
 *
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>
 
13
 *     check_column( 'wp_links', 'link_description', 'mediumtext' );
 
14
 *     if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) {
 
15
 *         echo "ok\n";
 
16
 *     }
 
17
 *
 
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
 *
 
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
35
34
 * @subpackage Plugin
44
43
 *
45
44
 * @since 1.0.0
46
45
 *
47
 
 * @uses $wpdb
 
46
 * @global wpdb $wpdb WordPress database abstraction object.
48
47
 *
49
48
 * @param string $table_name Database table name.
50
49
 * @param string $create_ddl Create database table SQL.
76
75
 *
77
76
 * @since 1.0.0
78
77
 *
79
 
 * @uses $wpdb
 
78
 * @global wpdb $wpdb WordPress database abstraction object.
80
79
 *
81
80
 * @param string $table_name Database table name
82
81
 * @param string $column_name Table column name
110
109
 *
111
110
 * @since 1.0.0
112
111
 *
113
 
 * @uses $wpdb
 
112
 * @global wpdb $wpdb WordPress database abstraction object.
114
113
 *
115
114
 * @param string $table_name Table name
116
115
 * @param string $column_name Column name