Mercurial > epgrec.yaz
view mediatomb.php @ 12:c4cb171f9453
new file: mediatomb.php
author | yoneda <yoneda@debian.localnet.mda.or.jp> |
---|---|
date | Mon, 13 Jul 2009 23:47:19 +0900 |
parents | |
children | b0fc647167f5 |
line wrap: on
line source
#!/usr/bin/php <?php include_once('config.php'); include_once(INSTALL_PATH.'/DBRecord.class.php'); try { $recs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL ); // DB接続 $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); if( $dbh === false ) exit( "mysql connection fail" ); $sqlstr = "use ".DB_NAME; mysql_query( $sqlstr ); $sqlstr = "set NAME utf8"; mysql_query( $sqlstr ); foreach( $recs as $rec ) { $sqlstr = "update mt_cds_object set metadata='dc:description=".$rec->description."' where dc_title='".$rec->path."'"; mysql_query( $sqlstr ); $sqlstr = "update mt_cds_object set dc_title='".$rec->title."' where dc_title='".$rec->path."'"; mysql_query( $sqlstr ); } } catch( Exception $e ) { exit( $e->getMessage() ); } ?>