[解決] 沒辦法新增版面>"< (已解決)

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
babycity
星球公民
星球公民
文章: 153
註冊時間: 2004-04-28 11:46

[解決] 沒辦法新增版面>"< (已解決)

文章 babycity »

新增新的版面時,就會跑出下面的訊息 :cry: 但我不知道是裝哪個mod出的問題,還有辦法救嗎>"<

一般錯誤
Couldn't insert row in forums table

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_forums (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, forum_rule, prune_enable, forum_topictypes, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_vote, auth_pollcreate) VALUES ('23', '1111', 1, '111, ''', 50, 0, 0,'[等你改],[]', 0, 0, 0, 0, 1, 1, 3, 3, 1, 1)

Line : 399
File : /home/babycity/public_html/phpbb/admin/admin_forums.php


這是394~424行

// There is no problem having duplicate forum names so we won't check for it.
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, forum_rule, prune_enable, forum_topictypes" . $field_sql . ")
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumrule']) . "'', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".$value_sql . ")";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert row in forums table", "", __LINE__, __FILE__, $sql);
}

if( $HTTP_POST_VARS['prune_enable'] )
{

if( $HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
message_die(GENERAL_MESSAGE, $lang['Set_prune_data']);
}

$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
VALUES('" . $next_id . "', " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert row in prune table", "", __LINE__, __FILE__, $sql);
}
}

$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

message_die(GENERAL_MESSAGE, $message);

break;

case 'modforum':
最後由 babycity 於 2005-02-15 15:37 編輯,總共編輯了 1 次。
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8547
註冊時間: 2004-04-30 01:54
來自: Taiwan

Re: [問題] 沒辦法新增版面>"<

文章 心靈捕手 »

babycity 寫:新增新的版面時,就會跑出下面的訊息 :cry: 但我不知道是裝哪個mod出的問題,還有辦法救嗎>"<

一般錯誤
Couldn't insert row in forums table

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_forums (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, forum_rule, prune_enable, forum_topictypes, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_vote, auth_pollcreate) VALUES ('23', '1111', 1, '111, ''', 50, 0, 0,'[等你改],[]', 0, 0, 0, 0, 1, 1, 3, 3, 1, 1)

Line : 399
File : /home/babycity/public_html/phpbb/admin/admin_forums.php


這是394~424行

// There is no problem having duplicate forum names so we won't check for it.
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, forum_rule, prune_enable, forum_topictypes" . $field_sql . ")
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumrule']) . "'', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".$value_sql . ")";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert row in forums table", "", __LINE__, __FILE__, $sql);
}

if( $HTTP_POST_VARS['prune_enable'] )
{

if( $HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
message_die(GENERAL_MESSAGE, $lang['Set_prune_data']);
}

$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
VALUES('" . $next_id . "', " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert row in prune table", "", __LINE__, __FILE__, $sql);
}
}

$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href="" . append_sid("admin_forums.$phpEx") . "">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href="" . append_sid("index.$phpEx?pane=right") . "">", "</a>");

message_die(GENERAL_MESSAGE, $message);

break;

case 'modforum':
我猜想是您安裝外掛( forum_rule) 時, 在插入 VALUE 的位置有誤!

以下的修改, 提供您參考:

代碼: 選擇全部

-----[find]-----
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumrule']) . "'', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".$value_sql . ")";

-----[replace]-----
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumrule']) . "', " . intval($HTTP_POST_VARS['prune_enable']) . ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".$value_sql . ")"; 

施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
babycity
星球公民
星球公民
文章: 153
註冊時間: 2004-04-28 11:46

[問題] ...

文章 babycity »

我有試過了替換,還是不行捏>"<我在試看看,謝謝,我知道是哪個外掛了^^
最後由 babycity 於 2005-02-15 12:36 編輯,總共編輯了 1 次。
baboo
星球公民
星球公民
文章: 79
註冊時間: 2004-02-11 10:23

文章 baboo »

, forum_topictypes" . $field_sql . ")

是不是這裡少了一個 ","?

, forum_topictypes, " . $field_sql . ")

----------------

好像不是.... :oops:

----------------

啊.. 應該是這裡:

"'', $next_order, " .

多了一個 '

還有這裡:
$HTTP_POST_VARS['forumdesc']) . ", '" . str_replace

少了一個 '
$HTTP_POST_VARS['forumdesc']) . "', '" . str_replace
babycity
星球公民
星球公民
文章: 153
註冊時間: 2004-04-28 11:46

[問題] 11

文章 babycity »

謝謝你們^^
已經修好了>"<
原來是這個外掛我之前有裝,forums.php剪剪貼貼有貼錯位子,後來沒理他,想說不裝了,才會這樣
主題已鎖定

回到「外掛問題討論」