Mercurial > epgrec.yaz
diff epgrec_upgrade.php @ 37:e5f9aa34d06f
change: modify all script for web base setting
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 28 Jul 2009 00:00:04 +0900 |
parents | 9ab4184561d9 |
children |
line wrap: on
line diff
--- a/epgrec_upgrade.php Mon Jul 27 22:27:54 2009 +0900 +++ b/epgrec_upgrade.php Tue Jul 28 00:00:04 2009 +0900 @@ -1,11 +1,14 @@ #!/usr/bin/php <?php include_once('config.php'); +include_once(INSTALL_PATH . '/Settings.class.php' ); - $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); +$settings = Settings::factory(); + + $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); if( $dbh !== false ) { - $sqlstr = "use ".DB_NAME; + $sqlstr = "use ".$settings->db_name; mysql_query( $sqlstr ); $sqlstr = "set NAMES 'utf8'"; @@ -13,15 +16,15 @@ // RESERVE_TBL // description -> text - $sqlstr = "alter table ".TBL_PREFIX.RESERVE_TBL." modify description text default null;"; + $sqlstr = "alter table ".RESERVE_TBL." modify description text default null;"; mysql_query( $sqlstr ); // path -> blob - $sqlstr = "alter table ".TBL_PREFIX.RESERVE_TBL." modify path blob default null;"; + $sqlstr = "alter table ".RESERVE_TBL." modify path blob default null;"; mysql_query( $sqlstr ); // PROGRAM_TBL // descripton -> text - $sqlstr = "alter table ".TBL_PREFIX.PROGRAM_TBL." modify description text default null;"; + $sqlstr = "alter table ".PROGRAM_TBL." modify description text default null;"; mysql_query( $sqlstr ); } else exit( "Can't connect DB\n");