Mercurial > epgrec.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
11:065d48346fff | 12:c4cb171f9453 |
---|---|
1 #!/usr/bin/php | |
2 <?php | |
3 | |
4 include_once('config.php'); | |
5 include_once(INSTALL_PATH.'/DBRecord.class.php'); | |
6 | |
7 try { | |
8 | |
9 $recs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL ); | |
10 | |
11 // DB接続 | |
12 $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); | |
13 if( $dbh === false ) exit( "mysql connection fail" ); | |
14 $sqlstr = "use ".DB_NAME; | |
15 mysql_query( $sqlstr ); | |
16 $sqlstr = "set NAME utf8"; | |
17 mysql_query( $sqlstr ); | |
18 | |
19 foreach( $recs as $rec ) { | |
20 $sqlstr = "update mt_cds_object set metadata='dc:description=".$rec->description."' where dc_title='".$rec->path."'"; | |
21 mysql_query( $sqlstr ); | |
22 $sqlstr = "update mt_cds_object set dc_title='".$rec->title."' where dc_title='".$rec->path."'"; | |
23 mysql_query( $sqlstr ); | |
24 } | |
25 } | |
26 catch( Exception $e ) { | |
27 exit( $e->getMessage() ); | |
28 } | |
29 ?> |