1 頁 (共 1 頁)

[問題]新增資料庫與欄位

發表於 : 2003-11-04 16:33
希希
在教學文件區中,有看見可新增欄位的文章。
但,我不懂要如何去新增。
安裝外掛時,也不知是要新增在哪一個資料庫底下。
例如:

代碼: 選擇全部

#
#-----[ ADD SQL ]------------------------------------------
#
ALTER TABLE users ADD user_birthday INT DEFAULT '999999' not null

發表於 : 2003-11-04 17:48
依夢兒
請用 phpMyAdmin 。

發表於 : 2003-11-04 17:49
Mac
ALTER TABLE users ADD user_birthday INT DEFAULT '999999' not null
前面要加上你的資料庫名稱,例如:
ALTER TABLE phpbb2_users ADD user_birthday INT DEFAULT '999999' not null

~Mac

發表於 : 2003-11-04 18:42
希希
謝謝依夢兒&Mac!
我是用phpMysqlAdmin,但,是否開啟哪一個資料庫都無仿呢?
因為,我那時開啟了phpbb_users這個資料庫去執行那段

代碼: 選擇全部

ALTER TABLE users ADD user_birthday INT DEFAULT '999999' not null
但,就是會出現錯誤!

代碼: 選擇全部

錯誤

SQL 語法 :  

ALTER TABLE users ADD user_birthday INT DEFAULT '999999' NOT NULL 

MySQL 傳回: 


Table 'news.users' doesn't exist
請問,是什麼原因呢?我錯在哪裡?

發表於 : 2003-11-04 18:44
希希
找到原因了,原來是我資料庫名稱給錯了。

發表於 : 2003-11-04 18:50
希希
再請問如下:

代碼: 選擇全部

# 
#-----[ SQL ]------------------------------------------
#
#   If you don't know how to execute sql queries, then copy
#   mysql_install.php into your phpbb directory and run it.
#   (assuming you use mysql)
#
#   If you don't use mysql, you'll have to edit these queries accordingly
# 
#   If you have a different table prefix then change this command accordingly. 
#   I have used the default table prefix! 
# 
INSERT INTO phpbb_config (config_name, config_value) VALUES
('cash_disable',0),
('cash_display_after_posts',1),
('cash_post_message','You earned %s for that post'),
('cash_disable_spam_num',10),
('cash_disable_spam_time',24),
('cash_disable_spam_message','You have exceeded the alloted amount of posts and will not earn anything for your post'),
('cash_installed','yes'),
('cash_version','2.0.2'),
('points_name','Points')
我應如何建立檔案呢?
而這個又意指?

發表於 : 2003-11-04 19:23
Mac
把這個貼到 phpmyadmin SQL 的指令欄裡面然後執行

代碼: 選擇全部

INSERT INTO phpbb_config (config_name, config_value) VALUES 
('cash_disable',0), 
('cash_display_after_posts',1), 
('cash_post_message','You earned %s for that post'), 
('cash_disable_spam_num',10), 
('cash_disable_spam_time',24), 
('cash_disable_spam_message','You have exceeded the alloted amount of posts and will not earn anything for your post'), 
('cash_installed','yes'), 
('cash_version','2.0.2'), 
('points_name','Points')
或者把 mysql_install.php 上傳到你的 phpBB 根目錄,從瀏覽器上執行
例如:http://xxx.xxx.xxx/xxx/mysql_install.php

~Mac

發表於 : 2003-11-04 19:48
希希
請問若是執行過mysql_install.php那是否cash mod下(說明檔中)的SQL都不用執行了呢?

發表於 : 2003-11-04 20:32
Mac

除非作者搞錯了,忘記把所有的 SQL 都放記執行檔中\r

~Mac

發表於 : 2003-11-04 23:37
希希
謝謝你!Mac
這幾天學到很多,蠻有成就感的。