From dc8d5836cf33ac1738a56c52b17d20eb1b6cbe5f Mon Sep 17 00:00:00 2001 From: saxmatt Date: Wed, 4 Jun 2003 19:55:33 +0000 Subject: [PATCH] New database fields. git-svn-id: http://svn.automattic.com/wordpress/trunk@165 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/wp-install.php | 51 +++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/wp-admin/wp-install.php b/wp-admin/wp-install.php index 9718c0349a..3444eadd9b 100644 --- a/wp-admin/wp-install.php +++ b/wp-admin/wp-install.php @@ -1,20 +1,7 @@ $msg

"; - echo "

query:
$sql

"; - echo "

error:
$error

"; - die(); -} -$connexion = mysql_connect($server, $loginsql, $passsql) or die("

Check your b2config.php file!

Can't connect to the database
".mysql_error()); -$dbconnexion = mysql_select_db($base, $connexion); - -if (!$dbconnexion) { - echo mysql_error(); - die(); -} $step = $HTTP_GET_VARS['step']; if (!$step) $step = 0; ?> @@ -79,7 +66,7 @@ $got_row = false;

Installing WP-Links.

Checking for tables...

All done!

\n"; } ?> -

Did you defeat the boss monster at the end? Good, then you’re ready for Step +

Did you defeat the boss monster at the end? Great! You’re ready for Step 2.

Step 2

-

First we’re going to create the necessary tables in the database...

+

First we’re going to create the necessary blog tables in the database...

query($query); ?>

The first table has been created! ...

@@ -205,7 +196,7 @@ $q = mysql_query($query) or mysql_doh("Doh, can't create the table \"$tableposts $now = date('Y-m-d H:i:s'); $query = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ('1', '$now', 'Welcome to WordPress. This is the first post. Edit or delete it, then start blogging!', 'Hello world!', '1')"; -$q = mysql_query($query) or mysql_doh("Doh, can't insert a first post in the table \"$tableposts\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); ?>

The test post has been inserted correctly...

@@ -214,20 +205,20 @@ $q = mysql_query($query) or mysql_doh("Doh, can't insert a first post in the tab // $query = "DROP TABLE IF EXISTS $tablecategories"; // $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tablecategories\" in the database."); -$query=" +$query = " CREATE TABLE $tablecategories ( cat_ID int(4) NOT NULL auto_increment, cat_name varchar(55) NOT NULL default '', PRIMARY KEY (cat_ID) ) "; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tablecategories\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); $query = "INSERT INTO $tablecategories (cat_ID, cat_name) VALUES ('0', 'General')"; -$q = mysql_query($query) or mysql_doh("doh, can't set the default category in the table \"$tablecategories\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); $query = "UPDATE $tableposts SET post_category = 1"; -$result = mysql_query($query) or mysql_doh("Oops, can't set the default category on $tableposts.", $query, mysql_error()); +$result = $wpdb->query($query); ?>

Categories are up and running...

@@ -250,11 +241,11 @@ CREATE TABLE $tablecomments ( PRIMARY KEY (comment_ID) ) "; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tablecomments\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); $now = date('Y-m-d H:i:s'); $query = "INSERT INTO $tablecomments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content) VALUES ('1', 'Mr WordPress', 'mr@wordpress.org', 'http://wordpress.org', '127.0.0.1', '$now', 'Hi, this is a comment.
To delete a comment, just log in, and view the posts\' comments, there you will have the option to edit or delete them.')"; -$q = mysql_query($query) or mysql_doh("doh, can't insert a first comment in the table \"$tablecomments\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); ?>

Comments are groovy...

@@ -276,10 +267,10 @@ CREATE TABLE $tablesettings ( PRIMARY KEY (ID) ) "; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tablesettings\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); $query = "INSERT INTO $tablesettings ( ID, posts_per_page, what_to_show, archive_mode, time_difference, AutoBR, time_format, date_format) VALUES ( '1', '20', 'posts', 'monthly', '0', '1', 'g:i a', 'n/j/Y')"; -$q = mysql_query($query) or mysql_doh("doh, can't set the default settings in the table \"$tablesettings\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); ?>

Settings are okay.

@@ -312,12 +303,12 @@ CREATE TABLE $tableusers ( UNIQUE KEY (user_login) ) "; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tableusers\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); $random_password = substr(md5(uniqid(microtime())),0,6); $query = "INSERT INTO $tableusers (ID, user_login, user_pass, user_firstname, user_lastname, user_nickname, user_icq, user_email, user_url, user_ip, user_domain, user_browser, dateYMDhour, user_level, user_aim, user_msn, user_yim, user_idmode) VALUES ( '1', 'admin', '$random_password', '', '', 'admin', '0', '$admin_email', '', '127.0.0.1', '127.0.0.1', '', '00-00-0000 00:00:01', '10', '', '', '', 'nickname')"; -$q = mysql_query($query) or mysql_doh("doh, can't set the default user in the table \"$tableusers\" in the database.", $query, mysql_error()); +$q = $wpdb->query($query); ?>