1 頁 (共 1 頁)

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

發表於 : 2005-02-15 11:04
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':

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

發表於 : 2005-02-15 12:20
心靈捕手
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 . ")"; 


[問題] ...

發表於 : 2005-02-15 12:35
babycity
我有試過了替換,還是不行捏>"<我在試看看,謝謝,我知道是哪個外掛了^^

發表於 : 2005-02-15 12:36
baboo
, forum_topictypes" . $field_sql . ")

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

, forum_topictypes, " . $field_sql . ")

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

好像不是.... :oops:

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

啊.. 應該是這裡:

"'', $next_order, " .

多了一個 '

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

少了一個 '
$HTTP_POST_VARS['forumdesc']) . "', '" . str_replace

[問題] 11

發表於 : 2005-02-15 15:37
babycity
謝謝你們^^
已經修好了>"<
原來是這個外掛我之前有裝,forums.php剪剪貼貼有貼錯位子,後來沒理他,想說不裝了,才會這樣