第 1 頁 (共 1 頁)
[問題]幫我寫一個簡易的install.php檔
發表於 : 2003-10-04 11:35
由 lasthero
因為我的phpMyAdmin因不明原因無法進入, 故想請會寫install.php的人可不可以
幫我寫一個, 我只要加入兩個東西即可:
#
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_forums ADD forum_display_sort TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_display_order TINYINT(1) NOT NULL;
#
拜託拜託!!

發表於 : 2003-10-04 12:18
由 jackyilk
你隨便去找一個有SQL執行檔的MOD
把裡面的執行語法刪除再把你所需要的相關資訊寫入就好了
自己動手做也許會更快可以解決你的問題~
發表於 : 2003-10-04 12:34
由 lasthero
要是我看的懂裡面的語法的話, 我早就自己弄了, 就是因為我不知道實際上要怎麼加,
在加上我這邊現有的install mod, 裡面都是寫一大串, 我哪知要看哪裡阿.....>.<
發表於 : 2003-10-04 12:37
由 lasthero
找到一篇相關的install.php語法:
<?php
/**
* This file should be placed in forums base directory and run, it should then be removed.
* It is intended for mySQL and is unlikely to work with any other database type.
* The query:
*
* ALTER TABLE prefix_users ADD `user_post_sort` TINYINT(2) DEFAULT '0' not null
*
* can be used as a reference for other databases if you know what you are doing.
*/
$phpbb_root_path = "./";
DEFINE('IN_PHPBB', TRUE);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'config.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
$sql = "ALTER TABLE " . $table_prefix . "users ADD `user_post_sort` TINYINT(2) DEFAULT '0' not null AFTER `user_popup_pm`";
$result = $db->sql_query($sql);
if ($result){
echo "Success";
}
Else {
echo "Failed";
}
?>
請問要如何改才能達到我要的功能:
#
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_forums ADD forum_display_sort TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_display_order TINYINT(1) NOT NULL;
#
發表於 : 2003-10-04 12:59
由 william91
發表於 : 2003-10-04 13:06
由 lasthero
感謝大大的協助, 馬上來試試看!! ^^