1 頁 (共 1 頁)

[問題]使用外掛主題類型分區劃(資料庫版)的問題

發表於 : 2004-08-25 02:42
yamank
請問各位高手 , 我依據http://phpbb-tw.net/phpbb/viewtopic.php ... 3%FE%AB%AC所指示的步驟安裝主題類型分區劃(資料庫版)

當安裝完畢 要在版面管理內在加新版面的話就會出現 :
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, prune_enable, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_vote, auth_pollcreate) VALUES ('4', '123', 1, '', 30, 0, 0,'[等你改],[]', 0, 0, 0, 0, 1, 1, 3, 3, 1, 1)

Line : 417
File : d:\appserv\www\phpbb2\admin\admin_forums.php

比對了一下 發現好像参數跟值沒有匹配到, 参數有17個 而數值有18個
發現原來裡面少了forum_topictypes
可是我有比對教學說明的步驟 內容也都沒問題 為何會發生這樣的情況呢....

代碼: 選擇全部

$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
				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']) . ", " . intval($HTTP_POST_VARS['prune_enable, forum_topictypes']) . ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".$value_sql . ")";
程式裡面明明有forum_topictypes的参數 為何沒有加入到MySQL內[/code]

發表於 : 2004-10-10 10:50
horacekau
我安裝之後也有這個問題耶? :-(

現在無法新增討論區了~

不知道問題在哪兒?

Re: [問題]使用外掛主題類型分區劃(資料庫版)的問題

發表於 : 2004-10-11 00:55
心靈捕手
yamank 寫:請問各位高手 , 我依據http://phpbb-tw.net/phpbb/viewtopic.php ... 3%FE%AB%AC所指示的步驟安裝主題類型分區劃(資料庫版)

當安裝完畢 要在版面管理內在加新版面的話就會出現 :
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, prune_enable, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_vote, auth_pollcreate) VALUES ('4', '123', 1, '', 30, 0, 0,'[等你改],[]', 0, 0, 0, 0, 1, 1, 3, 3, 1, 1)

Line : 417
File : d:\appserv\www\phpbb2\admin\admin_forums.php
假如您確定有增加 SQL 語法的話,
那麼很可能是某段程式碼的修改有誤.

方便貼出您的 admin\admin_forums.php 嗎?
我可以幫您檢查看看. ;-)

Re: [問題]使用外掛主題類型分區劃(資料庫版)的問題

發表於 : 2004-10-11 01:22
~倉木麻衣~
yamank 寫:

代碼: 選擇全部

$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
				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']) . ", " . intval([color=red]$HTTP_POST_VARS['prune_enable, forum_topictypes'][/color]) . ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".$value_sql . ")";
[/code]
問題出在底下那一行
intval($HTTP_POST_VARS['prune_enable, forum_topictypes'])

我想你還需要再仔細看一下原文件中的修改說明哦\r
因為你改錯地方了
正確的應該是\r

代碼: 選擇全部

$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable[color=#ff007f], forum_topictypes[/color]" . $field_sql . ") 
   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']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . [color=#ff007f]",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".[/color]$value_sql . ")";

發表於 : 2004-10-11 10:17
horacekau
感謝樓上兩位大大的熱心
的確!是小弟疏忽了
所以加錯地方\r
現在問題解決了
感謝~

(沒想到我跟一開始發問的大大竟然錯同一個地方 ^^""")