1
|
1 #!/usr/bin/php
|
|
2 <?php
|
|
3
|
|
4 require_once( "config.php" );
|
|
5 require_once( INSTALL_PATH. "/DBRecord.class.php" );
|
|
6
|
|
7 /*
|
|
8 $dbh = @mysql_connect( DB_HOST, DB_USER, DB_PASS );
|
|
9 if( $dbh === false ) {
|
|
10 exit("Can't connect DB\n" );
|
|
11 }
|
|
12
|
|
13 $sqlstr = "CREATE DATABASE IF NOT EXISTS ".DB_NAME;
|
|
14 $result = mysql_query( $sqlstr );
|
|
15 if( $result === false ) {
|
|
16 exit( "Quary error\n" );
|
|
17 }
|
|
18 */
|
|
19 try {
|
|
20 $rec = new DBRecord( TBL_PREFIX . RESERVE_TBL );
|
|
21 $rec->createTable( RESERVE_STRUCT );
|
|
22
|
|
23 $rec = new DBRecord( TBL_PREFIX . PROGRAM_TBL );
|
|
24 $rec->createTable( PROGRAM_STRUCT );
|
|
25
|
|
26 $rec = new DBRecord( TBL_PREFIX . CHANNEL_TBL );
|
|
27 $rec->createTable( CHANNEL_STRUCT );
|
|
28
|
|
29 $rec = new DBRecord( TBL_PREFIX . CATEGORY_TBL );
|
|
30 $rec->createTable( CATEGORY_STRUCT );
|
|
31
|
|
32 $rec = new DBRecord( TBL_PREFIX . KEYWORD_TBL );
|
|
33 $rec->createTable( KEYWORD_STRUCT );
|
|
34 }
|
|
35 catch( Exception $e ) {
|
|
36 exit( $e->getMessage() );
|
|
37 }
|
|
38 exit( "Complete!\n");
|
|
39 ?>
|