1 頁 (共 1 頁)

[問題]水怪RPG的問題...

發表於 : 2004-01-16 20:28
hk_andy_hk
問題外掛: 水怪RPG完整安裝版
參考連結: http://phpbb-tw.net/phpbb/viewtopic.php?t=20786
使用版本: phpBB 2.0.6
網站位置: http://e104.org/~funbroad/index.php
狀況描述:
我安裝了水怪RPG後... 一進入觀看文章就這樣了:
Could not obtain post/user information.

DEBUG MODE

SQL Error : 1054 Unknown column 'u.user_robfail' in 'field list'

SELECT u.username, u.user_money, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_robfail, u.rpg_level, u.rpg_cur_hp, u.rpg_max_hp, u.rpg_cur_mp, u.rpg_max_mp, u.rpg_cur_exp, u.rpg_max_exp, u.rpg_attack, u.rpg_defense, u.rpg_magic, u.rpg_speed, u.rpg_medals, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt WHERE p.topic_id = 24 AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time ASC LIMIT 0, 15

Line : 396
File : /hd2/home/funbroad/_www_/viewtopic.php

請問錯在那裡? 我已增加了SQL(還有蘿莉帝國刑場的未增加)

發表於 : 2004-01-17 10:57
hk_andy_hk
對不起... :oops:
原來在sql檔裡增少了一步 :oops:
問題解決了

發表於 : 2004-01-17 11:05
Virus
把... u.user_robfail 改成 u.user_rob_fail 就可以了....

發表於 : 2004-01-17 14:29
garychia
hk_andy_hk 寫:對不起... :oops:
原來在sql檔裡增少了一步 :oops:
問題解決了
請問如何修正我同樣錯誤不會改

發表於 : 2004-01-17 14:31
garychia
Virus 寫:把... u.user_robfail 改成 u.user_rob_fail 就可以了....
請問是改viewtopic.php檔案吧?我改後錯誤一樣

發表於 : 2004-01-17 14:39
Virus
Virus 寫:把... u.user_robfail 改成 u.user_rob_fail 就可以了....
啊咧...自爆....看錯了...
那欄位沒錯啦....真是不好意思.....
去看一下您的 phpbb_users 的 Table 裡面有沒有這個欄位....

發表於 : 2004-01-17 14:43
garychia
Virus 寫:
Virus 寫:把... u.user_robfail 改成 u.user_rob_fail 就可以了....
啊咧...自爆....看錯了...
那欄位沒錯啦....真是不好意思.....
去看一下您的 phpbb_users 的 Table 裡面有沒有這個欄位....
請問如何加入我不會?謝謝

發表於 : 2004-01-17 14:44
hk_andy_hk
garychia 寫:
Virus 寫:
Virus 寫:把... u.user_robfail 改成 u.user_rob_fail 就可以了....
啊咧...自爆....看錯了...
那欄位沒錯啦....真是不好意思.....
去看一下您的 phpbb_users 的 Table 裡面有沒有這個欄位....
請問如何加入我不會?謝謝
就是這段SQL:

ALTER TABLE `phpbb_users`
ADD `user_bank` int(11) unsigned NOT NULL default '0',
ADD `user_bank_time` int(11) default '0',
ADD `user_robfail` smallint(5) default '0',
ADD `rpg_rob_cnt` smallint(5) unsigned default '0',
ADD `rpg_robbed_cnt` smallint(5) unsigned default '0',
ADD `rpg_rob_succ` smallint(5) unsigned default '0',
ADD `rpg_rob_fail` smallint(5) unsigned default '0',
ADD `rpg_rob_money` int(11) unsigned default '0',
ADD `rpg_robbed_money` int(11) unsigned default '0',
ADD `rpg_level` smallint(5) NOT NULL default '1',
ADD `rpg_cur_exp` mediumint(8) NOT NULL default '0',
ADD `rpg_max_exp` mediumint(8) NOT NULL default '9',
ADD `rpg_cur_hp` mediumint(8) NOT NULL default '18',
ADD `rpg_max_hp` mediumint(8) NOT NULL default '18',
ADD `rpg_cur_mp` mediumint(8) NOT NULL default '8',
ADD `rpg_max_mp` mediumint(8) NOT NULL default '8',
ADD `rpg_attack` mediumint(8) NOT NULL default '1',
ADD `rpg_defense` mediumint(8) NOT NULL default '1',
ADD `rpg_magic` mediumint(8) NOT NULL default '1',
ADD `rpg_speed` mediumint(8) NOT NULL default '1',
ADD `rpg_medals` varchar(200) default '路人',
ADD `rpg_richer_pos` int(10) default NULL;

發表於 : 2004-01-17 14:51
garychia
有那段在SQL.sql檔案內如下{有更新資料阿}
# 個人資料
ALTER TABLE `phpbb_users`
ADD `user_bank` int(11) unsigned NOT NULL default '0',
ADD `user_bank_time` int(11) default '0',
ADD `user_robfail` smallint(5) default '0',
ADD `rpg_rob_cnt` smallint(5) unsigned default '0',
ADD `rpg_robbed_cnt` smallint(5) unsigned default '0',
ADD `rpg_rob_succ` smallint(5) unsigned default '0',
ADD `rpg_rob_fail` smallint(5) unsigned default '0',
ADD `rpg_rob_money` int(11) unsigned default '0',
ADD `rpg_robbed_money` int(11) unsigned default '0',
ADD `rpg_level` smallint(5) NOT NULL default '1',
ADD `rpg_cur_exp` mediumint(8) NOT NULL default '0',
ADD `rpg_max_exp` mediumint(8) NOT NULL default '9',
ADD `rpg_cur_hp` mediumint(8) NOT NULL default '18',
ADD `rpg_max_hp` mediumint(8) NOT NULL default '18',
ADD `rpg_cur_mp` mediumint(8) NOT NULL default '8',
ADD `rpg_max_mp` mediumint(8) NOT NULL default '8',
ADD `rpg_attack` mediumint(8) NOT NULL default '1',
ADD `rpg_defense` mediumint(8) NOT NULL default '1',
ADD `rpg_magic` mediumint(8) NOT NULL default '1',
ADD `rpg_speed` mediumint(8) NOT NULL default '1',
ADD `rpg_medals` varchar(200) default '路人',
ADD `rpg_richer_pos` int(10) default NULL;

發表於 : 2004-01-17 15:06
garychia
Virus 寫:
Virus 寫:把... u.user_robfail 改成 u.user_rob_fail 就可以了....
啊咧...自爆....看錯了...
那欄位沒錯啦....真是不好意思.....
去看一下您的 phpbb_users 的 Table 裡面有沒有這個欄位....
請問我把
ADD `user_robfail` smallint(5) default '0',

改為\r

ADD `user_rob_fail` smallint(5) default '0',

重新安裝資料庫則資料安裝程式回應如下
錯誤

SQL 語法 :

INSERT INTO phpbb_config
VALUES (

'rpg_jackpot', '100000'
)

MySQL 傳回:


Duplicate entry 'rpg_jackpot' for key 1

而網頁進入一樣顯示如下
Could not obtain post/user information.

DEBUG MODE

SQL Error : 1054 Unknown column 'u.user_robfail' in 'field list'

SELECT u.username, u.user_points, u.user_money, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile,u.user_robfail, u.rpg_level, u.rpg_cur_hp, u.rpg_max_hp, u.rpg_cur_mp, u.rpg_max_mp, u.rpg_cur_exp, u.rpg_max_exp, u.rpg_attack, u.rpg_defense, u.rpg_magic, u.rpg_speed, u.rpg_medals, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt WHERE p.topic_id = 279 AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time ASC LIMIT 0, 15

Line : 396
File : /home2/garychi/public_html/bbs/viewtopic.php

問題我不會請教一下謝謝您


[問題]sql問題

發表於 : 2004-01-20 12:39
dbangel
garychia 寫:有那段在SQL.sql檔案內如下{有更新資料阿}
# 個人資料
ALTER TABLE `phpbb_users`
ADD `user_bank` int(11) unsigned NOT NULL default '0',
ADD `user_bank_time` int(11) default '0',
ADD `user_robfail` smallint(5) default '0',
ADD `rpg_rob_cnt` smallint(5) unsigned default '0',
ADD `rpg_robbed_cnt` smallint(5) unsigned default '0',
ADD `rpg_rob_succ` smallint(5) unsigned default '0',
ADD `rpg_rob_fail` smallint(5) unsigned default '0',
ADD `rpg_rob_money` int(11) unsigned default '0',
ADD `rpg_robbed_money` int(11) unsigned default '0',
ADD `rpg_level` smallint(5) NOT NULL default '1',
ADD `rpg_cur_exp` mediumint(8) NOT NULL default '0',
ADD `rpg_max_exp` mediumint(8) NOT NULL default '9',
ADD `rpg_cur_hp` mediumint(8) NOT NULL default '18',
ADD `rpg_max_hp` mediumint(8) NOT NULL default '18',
ADD `rpg_cur_mp` mediumint(8) NOT NULL default '8',
ADD `rpg_max_mp` mediumint(8) NOT NULL default '8',
ADD `rpg_attack` mediumint(8) NOT NULL default '1',
ADD `rpg_defense` mediumint(8) NOT NULL default '1',
ADD `rpg_magic` mediumint(8) NOT NULL default '1',
ADD `rpg_speed` mediumint(8) NOT NULL default '1',
ADD `rpg_medals` varchar(200) default '路人',
ADD `rpg_richer_pos` int(10) default NULL;
可是我加入這段法語~卻出現\r

代碼: 選擇全部

資料庫 phpbb 在 localhost 執行 
錯誤

SQL 語法 :  

ADD `user_bank_time` int( 11 ) default '0', ADD `user_robfail` smallint( 5 ) default '0', ADD `rpg_rob_cnt` smallint( 5 ) unsigned default '0', ADD `rpg_robbed_cnt` smallint( 5 ) unsigned default '0', ADD `rpg_rob_succ` smallint( 5 ) unsigned default '0', ADD `rpg_rob_fail` smallint( 5 ) unsigned default '0', ADD `rpg_rob_money` int( 11 ) unsigned default '0', ADD `rpg_robbed_money` int( 11 ) unsigned default '0', ADD `rpg_level` smallint( 5 ) NOT NULL default '1', ADD `rpg_cur_exp` mediumint( 8 ) NOT NULL default '0', ADD `rpg_max_exp` mediumint( 8 ) NOT NULL default '9', ADD `rpg_cur_hp` mediumint( 8 ) NOT NULL default '18', ADD `rpg_max_hp` mediumint( 8 ) NOT NULL default '18', ADD `rpg_cur_mp` mediumint( 8 ) NOT NULL default '8', ADD `rpg_max_mp` mediumint( 8 ) NOT NULL default '8', ADD `rpg_attack` mediumint( 8 ) NOT NULL default '1', ADD `rpg_defense` mediumint( 8 ) NOT NULL default '1', ADD `rpg_magic` mediumint( 8 ) NOT NULL default '1', ADD `rpg_speed` mediumint( 8 ) NOT NULL default '1', ADD `rpg_medals` varchar( 200 ) default '路人', ADD `rpg_richer_pos` int( 10 ) default NULL 

MySQL 傳回: 


#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD  `user_bank_time` int( 11  ) default  '0',  ADD  `user_robf 
怎回事呢~請教各位前輩大大~有勞

發表於 : 2004-01-20 12:55
夢幻LUGIA
一句一句拆開來執行看看
有時候全部加在一起執行會有問題

發表於 : 2004-01-20 22:11
garychia
夢幻LUGIA 寫:一句一句拆開來執行看看
有時候全部加在一起執行會有問題
非常感謝是這樣沒錯已經完成

發表於 : 2004-01-21 09:12
dbangel
[quote="garychia"][quote="夢幻LUGIA"]一句一句拆開來執行看看
有時候全部加在一起執行會有問題[/quote]

[b]非常感謝[/b]是這樣沒錯已經完成[color=#e50000][/color][size=18][/size][/quote]

恩~分別執行增加欄位一個字一個字慢慢key上去可以成功~
只不過我的資料庫有規定:

[quote]* 如欄位格式是 "enum" 或 "set", 請使用以下的格式輸入: 'a','b','c'...
如在數值上需要輸入反斜線 (\) 或單引號 (') , 請再加上反斜線 (例如 '\\\xyz' or 'a\'b').
** 預設值: 請只輸入該預設值, 無需加上任何反斜線或引號 [/quote]

之前增加資料庫時都沒有單引號(')~
所以我也把單引號(')給去掉~
結果發現~
沒有單引號(')常常會被系統踢出來~
每點選一個地方也叫你重新登入~
若是加上單引號(')的話系統又恢復正常~
雖然成功增加了欄位~
所以就趕快修改程式碼~

[code]#-----[ 打開 ]-----------------------------------------------------------------------
#
includes/functions_post.php

#
#-----[ 尋找 ]-----------------------------------------------------------------------
#
if ($mode != 'poll_delete')
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts $sign
WHERE user_id = $user_id";
if (!$db->sql_query($sql, END_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
}

#
#-----[ 覆蓋為 ]---------------------------------------------------------------------
#
# 以下可自行設定發表主題與回覆文章時 HP 和 MP 以及經驗值的加減值\r
#
if ($mode != 'poll_delete')
{
// 水怪 RPG
if ( $mode == "newtopic" )
{
$reward_sql = ", rpg_cur_hp = rpg_cur_hp - 3, rpg_cur_mp = rpg_cur_mp - 3, rpg_cur_exp = rpg_cur_exp + 3"; // 發表主題 HP - 3 , MP - 3 , 經驗值 + 3
}
if ( $mode == "reply" )
{
$reward_sql = ", rpg_cur_hp = rpg_cur_hp - 2, rpg_cur_mp = rpg_cur_mp - 2, rpg_cur_exp = rpg_cur_exp + 2"; // 回覆文章 HP - 2 , MP - 2 , 經驗值 + 2
}
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts $sign $reward_sql
WHERE user_id = $user_id";
if (!$db->sql_query($sql, END_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Error in posting' . $sql, '', __LINE__, __FILE__, $sql);
}
LevelUp($user_id);
}


#-----[ 打開 ]-----------------------------------------------------------------------
#
viewtopic.php

#
#-----[ 尋找這一段 ]-----------------------------------------------------------------
#
$sql = "SELECT u.username, u.user_id
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id

#
#-----[ 在 $sql = "SELECT 後面尋找 ]-------------------------------------------------
#
u.user_allowsmile

#
#-----[ 之後, 加上 ]-----------------------------------------------------------------
#
, u.user_robfail, u.rpg_level, u.rpg_cur_hp, u.rpg_max_hp, u.rpg_cur_mp, u.rpg_max_mp, u.rpg_cur_exp, u.rpg_max_exp, u.rpg_attack, u.rpg_defense, u.rpg_magic, u.rpg_speed, u.rpg_medals

#-----[ 修改結束,存檔 ]------------------------------[/code]

但是還是無法跟資料庫接上~
在新增主題的時候送出卻出現~

[quote]一般錯誤

Error in postingUPDATE phpbb_users SET user_posts = user_posts + 1 , rpg_cur_hp = rpg_cur_hp - 3, rpg_cur_mp = rpg_cur_mp - 3, rpg_cur_exp = rpg_cur_exp + 3 WHERE user_id = 2

DEBUG MODE

SQL Error : 1196 Warning: Some non-transactional changed tables couldn't be rolled back

UPDATE phpbb_users SET user_posts = user_posts + 1 , rpg_cur_hp = rpg_cur_hp - 3, rpg_cur_mp = rpg_cur_mp - 3, rpg_cur_exp = rpg_cur_exp + 3 WHERE user_id = 2

Line : 485
File : xxxxxx\includes\functions_post.php [/quote]

還有:

[quote]一般錯誤

Could not obtain post/user information.

DEBUG MODE

SQL Error : 1054 Unknown column 'u.user_robfail' in 'field list'

SELECT u.username, u.user_money, u.user_id, u.user_posts, u.user_level, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_robfail, u.rpg_level, u.rpg_cur_hp, u.rpg_max_hp, u.rpg_cur_mp, u.rpg_max_mp, u.rpg_cur_exp, u.rpg_max_exp, u.rpg_attack, u.rpg_defense, u.rpg_magic, u.rpg_speed, u.rpg_medals, u.user_gender, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt WHERE p.topic_id = 12 AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time ASC LIMIT 0, 15

Line : 396
File : xxxxx\viewtopic.php [/quote]

接連是過好幾次都是如此~
所以我這邊的水怪到現在還是停擺著~
各位前輩能做個指導好嗎~謝謝各位大大~

補充一點~
若是有裝上"背景下雪"之外掛(裝在templates\xx\overall_footer.tpl底下)~
水怪的五子棋白旗子(電腦)會不能顯示出來~
代表這是相衝突到(有試過)~