|
| Author |
Message |
Lady Syren
Joined: 19 Sep 2005
Posts: 76
Location: Central United States
|
Posted: 11/6/2005, 11:14 pm Post subject: SQL Question |
|
|
I've added the medals system to a friend's community that I maintain/upgrade/ and basically run. Everything's gone just peachy (I also installed the admin upload utility and the medal upload utility).
One portion of the SQL keeps getting denied and the error I get is:
#1136 - Column count doesn't match value count at row 1
The SQL to enter is:
| Code: |
INSERT INTO `phpbb_config` VALUES ('allow_medal_display', '0');
INSERT INTO `phpbb_config` VALUES ('medal_display_row', '1');
INSERT INTO `phpbb_config` VALUES ('medal_display_col', '1');
INSERT INTO `phpbb_config` VALUES ('medal_display_width', '');
INSERT INTO `phpbb_config` VALUES ('medal_display_height', '');
INSERT INTO `phpbb_config` VALUES ('medal_display_order', '');
INSERT INTO `phpbb_medal_cat` VALUES ('1', 'Default', '10'); |
What does the error mean and how do I fix it and where? |
|
| Back to top |
|
 |
Thoul
Joined: 14 Sep 2005
Posts: 169
|
Posted: 11/7/2005, 7:25 am Post subject: |
|
|
When that happens you have to add the field names to the queries. Like this:
| Quote: |
| INSERT INTO `phpbb_config` (config_name, config_value) VALUES ('allow_medal_display', '0'); |
_________________ Phantasy Star: The Fringes of Algo | phpBB Smith |
|
| Back to top |
|
 |
Lady Syren
Joined: 19 Sep 2005
Posts: 76
Location: Central United States
|
Posted: 11/7/2005, 8:09 am Post subject: |
|
|
Great! Thank you! I do have another question. My friend and I have been trying to explain to the web host a slight problem in his phpmyadmin but its apparent that she's confused as to what it is we're talking about. Not that it matters, as I'm sure there is a way we can get around executing some of the queries that are required for some of the hacks and addons he wants.
My question is:
For instance, the artciles addon/hack is installed. Well, almost. All file edits have been done, all file uploads have been done. The only thing neither he nor I can get to do its job is the cms_install.php file. We both get this error:
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/xxxx/public_html/xxxx/db/mysql4.php on line 330
Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/xxxx/db/mysql4.php on line 331
phpBB : Critical Error
Could not connect to the database
Is there a way around this?
I thought I could just open the cms_install.php file and copy/paste the sql queries into the database myself through phpmyadmin, but after looking at that file, I see I can't do that. _________________ [ Sharnyl ][ New Houston ] |
|
| Back to top |
|
 |
Ex0dus
Joined: 26 Sep 2005
Posts: 235
Location: Zarasu, Lithuania
|
Posted: 11/7/2005, 7:35 pm Post subject: |
|
|
Provide the sql from the install file and ill convert it back to raw sql for you ^_^ just a matter of replacing some punctuation.
-Ex0dus |
|
| Back to top |
|
 |
Lady Syren
Joined: 19 Sep 2005
Posts: 76
Location: Central United States
|
Posted: 11/8/2005, 9:09 am Post subject: |
|
|
You rock and thank you so much! Remind me to send you some cookies at Christmas
| Code: |
<?php
/***************************************************************************
* cms_install.php
* -------------------
* copyright : ©2003 Freakin' Booty ;-P
* built for : phpBB easyCMS
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if( !$userdata['session_logged_in'] )
{
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid('login.'.$phpEx.'?redirect=cms_install.'.$phpEx));
exit;
}
if( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}
// Define schema info
$available_dbms = array(
'mysql'=> array(
'LABEL' => 'MySQL 3.x',
'SCHEMA' => 'mysql',
'DELIM' => ';',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_remarks'
),
'mysql4' => array(
'LABEL' => 'MySQL 4.x',
'SCHEMA' => 'mysql',
'DELIM' => ';',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_remarks'
)
);
/*,
'postgres' => array(
'LABEL' => 'PostgreSQL 7.x',
'SCHEMA' => 'postgres',
'DELIM' => ';',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_comments'
),
'mssql' => array(
'LABEL' => 'MS SQL Server 7/2000',
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_comments'
),
'msaccess' => array(
'LABEL' => 'MS Access [ ODBC ]',
'SCHEMA' => '',
'DELIM' => '',
'DELIM_BASIC' => ';',
'COMMENTS' => ''
),
'mssql-odbc' => array(
'LABEL' => 'MS SQL Server [ ODBC ]',
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_comments'
)
);*/
$page_title = 'Installing phpBB easyCMS';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
//
// Start executing the queries
//
include($phpbb_root_path . 'includes/db.'.$phpEx);
$dbms_schema = 'cms_schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_schema.sql';
$dbms_basic = 'cms_schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_basic.sql';
$remove_remarks = $available_dbms[$dbms]['COMMENTS'];
$delimiter = $available_dbms[$dbms]['DELIM'];
$delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC'];
if( $dbms != 'msaccess' )
{
echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Creating the tables</th></tr><tr><td><span class="genmed"><ul type="circle">';
// Load in the sql parser
include($phpbb_root_path.'includes/sql_parse.'.$phpEx);
// Ok we have the db info go ahead and read in the relevant schema
// and work on building the table.. probably ought to provide some
// kind of feedback to the user as we are working here in order
// to let them know we are actually doing something.
$sql_query = @fread(@fopen($dbms_schema, 'r'), @filesize($dbms_schema));
$sql_query = str_replace('phpbb_', $table_prefix, $sql_query);
$sql_query = $remove_remarks($sql_query);
$sql_query = split_sql_file($sql_query, $delimiter);
for( $i = 0; $i < sizeof($sql_query); $i++ )
{
if( trim($sql_query[$i]) != '' )
{
if( !$result = $db->sql_query($sql_query[$i]) )
{
$error = $db->sql_error();
echo '<li>' . $sql_query[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
}
else
{
echo '<li>' . $sql_query[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
}
}
}
echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>';
echo '<tr><th>Populating the tables</th></tr><tr><td><span class="genmed"><ul type="circle">';
// Ok tables have been built, let's fill in the basic information
$sql_query = @fread(@fopen($dbms_basic, 'r'), @filesize($dbms_basic));
$sql_query = preg_replace('/phpbb_/', $table_prefix, $sql_query);
$sql_query = $remove_remarks($sql_query);
$sql_query = split_sql_file($sql_query, $delimiter_basic);
for( $i = 0; $i < sizeof($sql_query); $i++ )
{
if( trim($sql_query[$i]) != '' )
{
if( !$result = $db->sql_query($sql_query[$i]) )
{
$error = $db->sql_error();
echo '<li>' . $sql_query[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
}
else
{
echo '<li>' . $sql_query[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
}
}
}
echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>';
}
echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now and the directory cms_schemas.<br />If you have run into any errors, please visit the <a href="http://www.phpbbhacks.com/forums" target="_phpbbhacks">phpBBHacks.com support forums</a> and ask someone for help.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
|
_________________ [ Sharnyl ][ New Houston ] |
|
| Back to top |
|
 |
Ex0dus
Joined: 26 Sep 2005
Posts: 235
Location: Zarasu, Lithuania
|
Posted: 11/8/2005, 1:12 pm Post subject: |
|
|
This was taken from the phpbb easy CMS download at phpbbhacks.com (version 1.0.6). I dont know if your version is newer, so if it is, dont use this and instead send me the version you have via email at xclarion@hotmail.com.
Change phpbb to whatever your table prefix is (if it doesnt happen to be phpbb)
| Code: |
CREATE TABLE phpbb_cms_articles (
article_id mediumint(8) unsigned NOT NULL auto_increment,
chapter_id smallint(5) unsigned NOT NULL default '0',
user_id mediumint(8) NOT NULL default '0',
article_icon mediumint(8) unsigned NOT NULL default '0',
article_views mediumint(8) unsigned NOT NULL default '0',
article_comments mediumint(8) unsigned NOT NULL default '0',
article_username varchar(255) NOT NULL default '',
article_ip varchar(8) NOT NULL default '',
time int(11) NOT NULL default '0',
article_pending tinyint(1) NOT NULL default '0',
enable_bbcode tinyint(1) NOT NULL default '0',
enable_html tinyint(1) NOT NULL default '0',
enable_smilies tinyint(1) NOT NULL default '0',
PRIMARY KEY (article_id),
KEY chapter_id (chapter_id),
KEY user_id (user_id),
KEY icon_id (article_icon)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_articles_rating (
article_id mediumint(8) unsigned NOT NULL default '0',
user_id mediumint(8) NOT NULL default '0',
user_ip char(8) NOT NULL default '',
rating tinyint(2) NOT NULL default '0',
time int(11) default NULL,
KEY article_id (article_id),
KEY user_id (user_id)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_articles_text (
article_id mediumint(8) NOT NULL default '0',
article_title varchar(255) NOT NULL default '',
article_text text NOT NULL,
bbcode_uid varchar(10) NOT NULL default '',
KEY article_id (article_id)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_auth_access (
group_id mediumint(8) unsigned NOT NULL default '0',
chapter_id smallint(5) unsigned NOT NULL default '0',
a_view tinyint(1) unsigned NOT NULL default '0',
a_read tinyint(1) unsigned NOT NULL default '0',
a_new tinyint(1) unsigned NOT NULL default '0',
a_edit tinyint(1) unsigned NOT NULL default '0',
a_delete tinyint(1) unsigned NOT NULL default '0',
a_rate tinyint(1) unsigned NOT NULL default '0',
a_approve tinyint(1) unsigned NOT NULL default '0',
c_view tinyint(1) unsigned NOT NULL default '0',
c_new tinyint(1) unsigned NOT NULL default '0',
c_edit tinyint(1) unsigned NOT NULL default '0',
c_delete tinyint(1) unsigned NOT NULL default '0',
c_rate tinyint(1) unsigned NOT NULL default '0',
c_approve tinyint(1) unsigned NOT NULL default '0',
KEY group_id (group_id),
KEY chapter_id (chapter_id)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_chapters (
chapter_id smallint(5) unsigned NOT NULL auto_increment,
chapter_name varchar(50) NOT NULL default '',
chapter_desc text NOT NULL,
chapter_img varchar(32) NOT NULL default '',
chapter_order smallint(5) NOT NULL default '0',
chapter_parent_id smallint(5) unsigned NOT NULL default '0',
pending_article tinyint(1) unsigned NOT NULL default '0',
pending_comments tinyint(1) unsigned NOT NULL default '0',
enable_comments tinyint(1) unsigned NOT NULL default '0',
stop_article_count tinyint(1) unsigned NOT NULL default '0',
stop_comment_count tinyint(1) unsigned NOT NULL default '0',
chapter_articles mediumint(8) unsigned NOT NULL default '0',
chapter_comments mediumint(8) unsigned NOT NULL default '0',
a_view tinyint(1) unsigned NOT NULL default '0',
a_read tinyint(1) unsigned NOT NULL default '0',
a_new tinyint(1) unsigned NOT NULL default '0',
a_edit tinyint(1) unsigned NOT NULL default '0',
a_delete tinyint(1) unsigned NOT NULL default '0',
a_rate tinyint(1) unsigned NOT NULL default '0',
a_approve tinyint(1) unsigned NOT NULL default '0',
c_view tinyint(1) unsigned NOT NULL default '0',
c_new tinyint(1) unsigned NOT NULL default '0',
c_edit tinyint(1) unsigned NOT NULL default '0',
c_delete tinyint(1) unsigned NOT NULL default '0',
c_rate tinyint(1) unsigned NOT NULL default '0',
c_approve tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (chapter_id),
KEY chapter_parent_id (chapter_parent_id,chapter_id)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_comments (
comment_id mediumint(8) unsigned NOT NULL auto_increment,
article_id mediumint(8) unsigned NOT NULL default '0',
chapter_id smallint(5) unsigned NOT NULL default '0',
user_id mediumint(8) NOT NULL default '0',
comment_icon mediumint(8) unsigned NOT NULL default '0',
comment_username varchar(20) NOT NULL default '',
comment_ip varchar(8) NOT NULL default '',
time int(11) NOT NULL default '0',
comment_pending tinyint(1) unsigned NOT NULL default '0',
enable_html tinyint(1) unsigned NOT NULL default '0',
enable_bbcode tinyint(1) unsigned NOT NULL default '0',
enable_smilies tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (comment_id),
KEY user_id (user_id),
KEY article_id (article_id),
KEY chapter_id (chapter_id)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_comments_rating (
comment_id mediumint(8) unsigned NOT NULL default '0',
user_id mediumint(8) NOT NULL default '0',
user_ip char(8) NOT NULL default '',
rating tinyint(2) NOT NULL default '0',
time int(11) default NULL,
KEY comments_id (comment_id),
KEY user_id (user_id)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_comments_text (
comment_id mediumint(8) unsigned NOT NULL default '0',
article_id mediumint(8) unsigned NOT NULL default '0',
subject varchar(255) NOT NULL default '',
comments text NOT NULL,
bbcode_uid varchar(10) NOT NULL default '',
KEY comment_id (comment_id),
KEY article_id (article_id)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_config (
config_name varchar(255) NOT NULL default '',
config_value varchar(255) NOT NULL default '',
PRIMARY KEY (config_name)
) TYPE=MyISAM;
CREATE TABLE phpbb_cms_icons (
icon_id mediumint(8) unsigned NOT NULL auto_increment,
icon_href varchar(100) NOT NULL default '',
icon_order mediumint(4) NOT NULL default '0',
PRIMARY KEY (icon_id)
) TYPE=MyISAM;
INSERT INTO phpbb_cms_articles (article_id, chapter_id, user_id, article_icon, article_views, article_comments, article_username, article_ip, time, article_pending, enable_bbcode, enable_html, enable_smilies) VALUES (1, 1, 2, 1, 0, 0, '', '', 1058702329, 0, 1, 1, 1);
INSERT INTO phpbb_cms_articles_text (article_id, article_title, article_text, bbcode_uid) VALUES (1, 'Welcome to phpBB easyCMS', 'This is just an example article, and I suggest you delete it if you don\'t want to look like a fool to all your board members ;) \r\n\r\nFor support, please visit the [url=http://www.phpbbhacks.com/forums]phpBBHacks.com support forums[/url].\r\n\r\nRegards,\r\nFB-ke.', 'a449763436');
INSERT INTO phpbb_cms_chapters (chapter_id, chapter_name, chapter_desc, chapter_img, chapter_order, chapter_parent_id, pending_article, pending_comments, enable_comments, stop_article_count, stop_comment_count, chapter_articles, chapter_comments, a_view, a_read, a_new, a_edit, a_delete, a_rate, a_approve, c_view, c_new, c_edit, c_delete, c_rate, c_approve) VALUES (1, 'Test chapter', 'Just your average test chapter of phpBB easyCMS.', '', 10, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 5, 0, 1, 1, 1, 1, 5);
INSERT INTO phpbb_cms_config (config_name, config_value) VALUES ('allow_html', '0'),
('allow_bbcode', '1'),
('allow_smilies', '1'),
('allow_avatar', '0'),
('icons_path', 'images/icons'),
('articles_per_page', '25'),
('comments_per_page', '10'),
('max_rating', '5'),
('articles_on_list', '5');
INSERT INTO phpbb_cms_icons (icon_id, icon_href, icon_order) VALUES (1, '3_points.gif', 10),
(2, 'arrow_bold_rgt.gif', 20),
(3, 'arrow_dot_rgt.gif', 30),
(4, 'arrow_rgt.gif', 40),
(5, 'asterix.gif', 50),
(6, 'double_quote.gif', 60),
(7, 'flash.gif', 70),
(8, 'musical.gif', 80),
(9, 'pin.gif', 90),
(10, 'recycle.gif', 100),
(11, 'square.gif', 110),
(12, 'star_nasa.gif', 120),
(13, 'star.gif', 130);
ALTER TABLE phpbb_users ADD COLUMN user_articles mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER user_posts;
ALTER TABLE phpbb_users ADD COLUMN user_comments mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER user_articles;
UPDATE phpbb_users SET user_articles = 1 WHERE user_id = 2; |
-Ex0dus
p.s. I like cookies >_<
Last edited by Ex0dus on 11/8/2005, 4:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
Lady Syren
Joined: 19 Sep 2005
Posts: 76
Location: Central United States
|
Posted: 11/8/2005, 3:09 pm Post subject: |
|
|
I could hug you! Thank you so very, very much! Yup, its the same version. That's where I downloaded it from. Was that suppose to be included in the files?
PS: I'm an excellent baker Let me know where to send the cookies to  |
|
| Back to top |
|
 |
Ex0dus
Joined: 26 Sep 2005
Posts: 235
Location: Zarasu, Lithuania
|
Posted: 11/8/2005, 4:18 pm Post subject: |
|
|
Not a problem ^_^ and shipping to where i live would be too much trouble ^_^ Ill just settle for some yummy e-cookies.
To explain how it works, the installer file you showed, calls 2 other files in and executes their sql. Those two files are cms_schemas/mysql_basic.sql and cms_schemas/mysql_basic.sql
The hint in the file is where it says
| Code: |
$dbms_schema = 'cms_schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_schema.sql';
$dbms_basic = 'cms_schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_basic.sql'; |
Its basically saying, lets pull the instructions from those files. A phpbb installer script (and scripts for many bulletin boards and some mods) work like this ^_^
If you ever need more help be sure to let me know ^_^
Glad to be of assistance,
-Ex0dus |
|
| Back to top |
|
 |
Lady Syren
Joined: 19 Sep 2005
Posts: 76
Location: Central United States
|
Posted: 11/9/2005, 3:59 am Post subject: |
|
|
You'd end up hating me if I continually came to you for assistance But, I will take you up on that in a few days for a couple of other minor things. Nothing major, I assure you. And thank you very much for your help! *passes a huge box full of yummy cookies under the table* |
|
| Back to top |
|
 |
Ex0dus
Joined: 26 Sep 2005
Posts: 235
Location: Zarasu, Lithuania
|
Posted: 11/9/2005, 9:47 am Post subject: |
|
|
haha so long as you arent having me make template changes and images, i dont really mind it so much >_<
Thanks for the cookies >_<
-Ex0dus |
|
| Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|