OSDN Git Service

added: remove video with real file.
[epgrec/epgrec.git] / mediatomb.php
1 #!/usr/bin/php
2 <?php
3
4 include_once('config.php');
5 include_once(INSTALL_PATH.'/DBRecord.class.php');
6 include_once(INSTALL_PATH.'/reclib.php');
7
8 try {
9
10   $recs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL );
11
12 // DB接続
13   $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS );
14   if( $dbh === false ) exit( "mysql connection fail" );
15   $sqlstr = "use ".DB_NAME;
16   mysql_query( $sqlstr );
17   $sqlstr = "set NAME utf8";
18   mysql_query( $sqlstr );
19
20   foreach( $recs as $rec ) {
21           $title = $rec->title."(".date("Y/m/d", toTimestamp($rec->starttime)).")";
22       $sqlstr = "update mt_cds_object set metadata='dc:description=".$rec->description."' where dc_title='".$rec->path."'";
23       mysql_query( $sqlstr );
24       $sqlstr = "update mt_cds_object set dc_title='".$title."' where dc_title='".$rec->path."'";
25       mysql_query( $sqlstr );
26   }
27 }
28 catch( Exception $e ) {
29     exit( $e->getMessage() );
30 }
31 ?>