Index: trunk/install/php/reserveepg.php =================================================================== --- trunk/install/php/reserveepg.php (リビジョン 70) +++ trunk/install/php/reserveepg.php (リビジョン 94) @@ -56,13 +56,13 @@ stationname , stationrecch ,stationid FROM foltia_epg , foltia_station - WHERE epgid='$epgid' AND foltia_station.ontvcode = foltia_epg.ontvchannel + WHERE epgid = ? AND foltia_station.ontvcode = foltia_epg.ontvchannel ";//4812 - $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($epgid)); +$rowdata = $rs->fetch(); +if (! $rowdata) { die_exit("登録番組がありません
"); } - $rowdata = pg_fetch_row($rs, 0); + //$title = htmlspecialchars($rowdata[0]); ?> @@ -136,33 +136,21 @@ $query = " SELECT -foltia_program .title, -foltia_program .tid, -stationname, -foltia_station.stationid , -foltia_subtitle.countno, -foltia_subtitle.subtitle, -foltia_subtitle.startdatetime , -foltia_subtitle.lengthmin , -foltia_tvrecord.bitrate , -foltia_subtitle.startoffset , -foltia_subtitle.pid + foltia_program.title, foltia_program.tid, stationname, + foltia_station.stationid, foltia_subtitle.countno, + foltia_subtitle.subtitle, foltia_subtitle.startdatetime, + foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, + foltia_subtitle.startoffset, foltia_subtitle.pid FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid -AND foltia_subtitle.startdatetime ='$startfoltime' -AND foltia_subtitle.enddatetime = '$endfoltime' -AND foltia_station.stationid = '$stationid' +AND foltia_subtitle.startdatetime = ? +AND foltia_subtitle.enddatetime = ? +AND foltia_station.stationid = ? UNION SELECT -foltia_program .title, -foltia_program .tid, -stationname, -foltia_station.stationid , -foltia_subtitle.countno, -foltia_subtitle.subtitle, -foltia_subtitle.startdatetime , -foltia_subtitle.lengthmin , -foltia_tvrecord.bitrate , -foltia_subtitle.startoffset , -foltia_subtitle.pid + foltia_program.title, foltia_program.tid, stationname, + foltia_station.stationid, foltia_subtitle.countno, + foltia_subtitle.subtitle, foltia_subtitle.startdatetime, + foltia_subtitle.lengthmin, foltia_tvrecord.bitrate, + foltia_subtitle.startoffset, foltia_subtitle.pid FROM foltia_tvrecord LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) @@ -170,23 +158,20 @@ LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) WHERE foltia_tvrecord.stationid = 0 -AND foltia_subtitle.startdatetime ='$startfoltime' -AND foltia_subtitle.enddatetime = '$endfoltime' -AND foltia_station.stationid = '$stationid' +AND foltia_subtitle.startdatetime = ? +AND foltia_subtitle.enddatetime = ? +AND foltia_station.stationid = ? "; - - - $rs = m_query($con, $query, "DBクエリに失敗しました"); - $maxrows = pg_num_rows($rs); - //print ""; print "
\n"; - if ($maxrows == 0) { +//$rs = m_query($con, $query, "DBクエリに失敗しました"); +$rs = sql_query($con, $query, "DBクエリに失敗しました",array($startfoltime,$endfoltime,$stationid,$startfoltime,$endfoltime,$stationid)); +$chkoverwrap = $rs->fetch(); +if (! $chkoverwrap) { //重複なし print "
\n"; }else{ - $chkoverwrap = pg_fetch_row($rs, 0); $prereservedtitle = htmlspecialchars($chkoverwrap[0]); $tid = htmlspecialchars($chkoverwrap[1]);