Help with the installation. Please!
-
This is the file that i get everytime i do install.php. what am i doing wrong? and why does it say i hv it installed already. what do i need to do to get it running. also it says: you need to clear old database file, how do i do that? i am very very new to sql and php. Any help will be appreciated. Thanks much
—————————————
hide_errors();
$installed = $wpdb->get_results(“SELECT * FROM $tableusers”);
if ($installed) die(‘
You appear to already have WordPress installed. If you would like to reinstall please clear your old database files first.
‘);
$wpdb->show_errors();
switch($step) {
case 0:
?>
Welcome to WordPress. We’re now going to go through a few steps to get you up and running with the latest in personal publishing platforms. Before we get started, remember that we require a PHP version of at least 4.0.6, you have . Look good? You also need to set up the database connection information in wp-config.php. Have you looked at the readme? If you’re all ready, let’s go!
Step 1
Okay first we’re going to set up the links database. This will allow you to host your own blogroll, complete with Weblogs.com updates.
Installing WP-Links.
Checking for tables…
\n”;
}
if (!$got_cats) {
echo “
Can’t find table ‘$tablelinkcategories’, gonna create it…
\n”;
$sql = “CREATE TABLE $tablelinkcategories ( ” .
” cat_id int(11) NOT NULL auto_increment, ” .
” cat_name tinytext NOT NULL, “.
” auto_toggle enum (‘Y’,’N’) NOT NULL default ‘N’, “.
” show_images enum (‘Y’,’N’) NOT NULL default ‘Y’, ” .
” show_description enum (‘Y’,’N’) NOT NULL default ‘Y’, ” .
” show_rating enum (‘Y’,’N’) NOT NULL default ‘Y’, ” .
” show_updated enum (‘Y’,’N’) NOT NULL default ‘Y’, ” .
” sort_order varchar(64) NOT NULL default ‘name’, ” .
” sort_desc enum(‘Y’,’N’) NOT NULL default ‘N’, ” .
” text_before_link varchar(128) not null default ”, ” .
# ” text_after_link varchar(128) not null default ‘
‘,” .
” text_after_all varchar(128) not null default ‘
‘, ” .
” list_limit int not null default -1, ” .
” PRIMARY KEY (cat_id) “.
“) “;
$result = mysql_query($sql) or print (“Can’t create the table ‘$tablelinkcategories’ in the database.
” . $sql . “
” . mysql_error());
if ($result != false) {
echo “
Table ‘$tablelinkcategories’ created OK
\n”;
$got_cats = true;
}
} else {
echo “
Found table ‘$tablelinkcategories’, don’t need to create it…
\n”;
$got_cats = true;
}
if (!$got_links) {
echo “
Can’t find ‘$tablelinks’, gonna create it…
\n”;
$sql = “CREATE TABLE $tablelinks ( ” .
” link_id int(11) NOT NULL auto_increment, ” .
” link_url varchar(255) NOT NULL default ”, ” .
” link_name varchar(255) NOT NULL default ”, ” .
” link_image varchar(255) NOT NULL default ”, ” .
” link_target varchar(25) NOT NULL default ”, ” .
” link_category int(11) NOT NULL default 0, ” .
” link_description varchar(255) NOT NULL default ”, ” .
” link_visible enum (‘Y’,’N’) NOT NULL default ‘Y’, ” .
” link_owner int NOT NULL DEFAULT ‘1’, ” .
” link_rating int NOT NULL DEFAULT ‘0’, ” .
” link_updated DATETIME NOT NULL DEFAULT ‘0000-00-00 00:00:00’, ” .
” link_rel varchar(255) NOT NULL default ”, ” .
” link_notes MEDIUMTEXT NOT NULL default ”, ” .
” PRIMARY KEY (link_id) ” .
“) “;
$result = mysql_query($sql) or print (“Can’t create the table ‘$tablelinks’ in the database.
” . $sql . “
” . mysql_error());
$links = mysql_query(“INSERT INTO $tablelinks VALUES (”, ‘http://ww.wp.xz.cn/’, ‘WordPress’, ”, ”, 1, ”, ‘Y’, 1, 0, ‘0000-00-00 00:00:00’, ”, ”);”);
$links = mysql_query(“INSERT INTO $tablelinks VALUES (”, ‘http://photomatt.net/’, ‘Matt’, ”, ”, 1, ”, ‘Y’, 1, 0, ‘0000-00-00 00:00:00’, ”, ”);”);
$links = mysql_query(“INSERT INTO $tablelinks VALUES (”, ‘http://zed1.com/journalized/’, ‘Mike’, ”, ”, 1, ”, ‘Y’, 1, 0, ‘0000-00-00 00:00:00’, ”, ”);”);
$links = mysql_query(“INSERT INTO $tablelinks VALUES (”, ‘http://www.alexking.org/’, ‘Alex’, ”, ”, 1, ”, ‘Y’, 1, 0, ‘0000-00-00 00:00:00’, ”, ”);”);
$links = mysql_query(“INSERT INTO $tablelinks VALUES (”, ‘http://dougal.gunters.org/’, ‘Dougal’, ”, ”, 1, ”, ‘Y’, 1, 0, ‘0000-00-00 00:00:00’, ”, ”);”);
if ($result != false) {
echo “
Table ‘$tablelinks’ created OK
\n”;
$got_links = true;
}
} else {
echo “
Found table ‘$tablelinks’, don’t need to create it…
\n”;
$got_links = true;
}
if ($got_links && $got_cats) {
echo “
Looking for category 1…
\n”;
$sql = “SELECT * FROM $tablelinkcategories WHERE cat_id=1 “;
$result = mysql_query($sql) or print (“Can’t query ‘$tablelinkcategories’.
” . $sql . “
” . mysql_error());
if ($result != false) {
if ($row = mysql_fetch_object($result)) {
echo “
You have at least 1 category. Good!
\n”;
$got_row = true;
} else {
echo “
Gonna insert category 1…
\n”;
$sql = “INSERT INTO $tablelinkcategories (cat_id, cat_name) VALUES (1, ‘Links’)”;
$result = mysql_query($sql) or print (“Can’t query insert category.
” . $sql . “
” . mysql_error());
if ($result != false) {
echo “
Inserted category Ok
\n”;
$got_row = true;
}
}
}
}
if ($got_row) {
echo “
All done!
\n”;
}
?>
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 blog tables in the database…
query($query);
?>
The first table has been created! …
query($query);
?>
The test post has been inserted correctly…
query($query);
$query = “INSERT INTO $tablecategories (cat_ID, cat_name) VALUES (‘0’, ‘General’)”;
$q = $wpdb->query($query);
$query = “UPDATE $tableposts SET post_category = 1”;
$result = $wpdb->query($query);
?>
Categories are up and running…
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’, ‘[email protected]’, ‘http://ww.wp.xz.cn’, ‘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 = $wpdb->query($query);
?>
Comments are groovy…
query($query);
// $query = “DROP TABLE IF EXISTS $tableoptiontypes”;
// $q = mysql_query($query) or mysql_doh(“doh, can’t drop the table \”$tableoptiontypes\” in the database.”);
$query = “
CREATE TABLE $tableoptiontypes (
optiontype_id int(11) NOT NULL auto_increment,
optiontype_name varchar(64) NOT NULL,
PRIMARY KEY (optiontype_id)
)
“;
$q = $wpdb->query($query);
// $query = “DROP TABLE IF EXISTS $tableoptiongroups”;
// $q = mysql_query($query) or mysql_doh(“doh, can’t drop the table \”$tableoptiongroups\” in the database.”);
$query = “
CREATE TABLE $tableoptiongroups (
group_id int(11) NOT NULL auto_increment,
group_name varchar(64) not null,
group_desc varchar(255),
group_longdesc tinytext,
PRIMARY KEY (group_id)
)
“;
$q = $wpdb->query($query);
// $query = “DROP TABLE IF EXISTS $tableoptiongroup_options”;
// $q = mysql_query($query) or mysql_doh(“doh, can’t drop the table \”$tableoptiongroup_options\” in the database.”);
$query = “
CREATE TABLE $tableoptiongroup_options (
group_id int(11) NOT NULL,
option_id int(11) NOT NULL,
seq int(11) NOT NULL,
PRIMARY KEY (group_id, option_id)
)
“;
$q = $wpdb->query($query);
// $query = “DROP TABLE IF EXISTS $tableoptionvalues”;
// $q = mysql_query($query) or mysql_doh(“doh, can’t drop the table \”$tableoptionvalues\” in the database.”);
$query = “
CREATE TABLE $tableoptionvalues (
option_id int(11) NOT NULL,
optionvalue tinytext,
optionvalue_desc varchar(255),
optionvalue_max int(11),
optionvalue_min int(11),
optionvalue_seq int(11),
UNIQUE (option_id, optionvalue(255)),
INDEX (option_id, optionvalue_seq)
)
“;
$q = $wpdb->query($query);
?>
Option Tables created okay.
tag?’, 8, 20)”,
“INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(24,’rss_excerpt_length’, 1, ’50’, ‘length (in words) of excerpts in the RSS feed? 0=unlimited note: in b2rss.php, this will be set to 0 if you use
The topic ‘Help with the installation. Please!’ is closed to new replies.