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

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

版主: 版主管理群

主題已鎖定
yamank
星球普通子民
星球普通子民
文章: 6
註冊時間: 2004-04-23 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

比對了一下 發現好像参數跟值沒有匹配到, 参數有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]
horacekau
星球普通子民
星球普通子民
文章: 11
註冊時間: 2002-07-06 18:28
聯繫:

文章 horacekau »

我安裝之後也有這個問題耶? :-(

現在無法新增討論區了~

不知道問題在哪兒?
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8516
註冊時間: 2004-04-30 01:54
來自: Taiwan

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

文章 心靈捕手 »

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 嗎?
我可以幫您檢查看看. ;-)
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

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

文章 ~倉木麻衣~ »

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 . ")";
horacekau
星球普通子民
星球普通子民
文章: 11
註冊時間: 2002-07-06 18:28
聯繫:

文章 horacekau »

感謝樓上兩位大大的熱心
的確!是小弟疏忽了
所以加錯地方\r
現在問題解決了
感謝~

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

回到「外掛問題討論」