Index: trunk/install/php/showlibc.php
===================================================================
--- trunk/install/php/showlibc.php (リビジョン 83)
+++ trunk/install/php/showlibc.php (リビジョン 94)
@@ -68,10 +68,11 @@
SELECT foltia_program.title
FROM foltia_program
-WHERE foltia_program.tid = $tid
-";
-$rs = m_query($con, $query, "DBクエリに失敗しました");
-$maxrows = pg_num_rows($rs);
-if ($maxrows == 0 ){
- $syobocaldb = `curl "http://cal.syoboi.jp/db?Command=TitleLookup&TID=$tid" | head -2 `;
+WHERE foltia_program.tid = ?
+";
+//$rs = m_query($con, $query, "DBクエリに失敗しました");
+$rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid));
+$rowdata = $rs->fetch();
+if (! $rowdata) {
+$syobocaldb = `curl "http://cal.syoboi.jp/db?Command=TitleLookup&TID=$tid" | head -2 `;
$syobocaldb = mb_convert_encoding($syobocaldb, "EUC-JP", "UTF-8");
$syobocaldb = preg_match("/
.*<\/Title>/", $syobocaldb,$title);
@@ -80,5 +81,4 @@
$title = htmlspecialchars($title) ;
}else{
-$rowdata = pg_fetch_row($rs, 0);
$title = $rowdata[0];
$title = htmlspecialchars($title) ;
@@ -143,12 +143,13 @@
LEFT JOIN foltia_program
ON foltia_mp4files.tid = foltia_program.tid
-WHERE foltia_mp4files.tid = $tid
+WHERE foltia_mp4files.tid = ?
ORDER BY \"startdatetime\" ASC
";
$rs = "";
-$rs = m_query($con, $query, "DBクエリに失敗しました");
-$maxrows = pg_num_rows($rs);
-if ($maxrows > 0 ){
+//$rs = m_query($con, $query, "DBクエリに失敗しました");
+$rs = sql_query($con, $query, "DBクエリに失敗しました",array($tid));
+$rowdata = $rs->fetch();
+if ($rowdata) {
if(ereg("iPhone",$useragent)){
print "";
@@ -159,7 +160,5 @@
";
}
-for ($row = 0; $row < $maxrows; $row++) {
- $rowdata = pg_fetch_row($rs, $row);
-
+ do {
$title = $rowdata[1];
@@ -195,8 +194,8 @@
}
//Starlight Breaker向け拡張
-//$debug_pg_num_rows = pg_num_rows ($rs );
+//$debug_pg_num_rows = $rs ->rowCount();
$caplink = "";
-if (($sbpluginexist == 1) && (pg_num_rows ($rs ) > 0)){
+ if ($sbpluginexist == 1) {
//$capimgpath = htmlspecialchars(preg_replace("/.m2p/", "", $rowdata[5]));
$capimgpath = htmlspecialchars(preg_replace("/.m2./", "", $rowdata[5]));
@@ -244,5 +243,5 @@
}//endif iPhone
-}//for
+ } while ($rowdata = $rs->fetch());
}else{
print "録画ファイルがありません
\n";