prepare($sql); $sth->bindparam(':p_id', $_GET["p"], PDO::PARAM_INT); $sth ->execute(); $psingle = $sth -> fetch(); //echo ""; //echo ""; $sql = "select * from ptype as a left outer join p as b on a.ptype_id=b.ptype_id where b.p_id=:p_id"; $sth = $dbh -> prepare($sql); $sth->bindparam(':p_id', $_GET["p"], PDO::PARAM_INT); $sth ->execute(); $ptype = $sth -> fetch(); $sql = "select * from p where ptype_id=:ptype_id and p_open=1 and p_id <> :p_id order by rand() desc limit 6"; $sth = $dbh -> prepare($sql); $sth->bindparam(':ptype_id', $ptype["ptype_id"], PDO::PARAM_INT); $sth->bindparam(':p_id', $_GET["p"], PDO::PARAM_INT); $sth ->execute(); $ps = $sth -> fetchAll(); $sql = "select * from pimage where pimage_open=1 and p_id=:p_id order by pimage_sort desc"; $sth = $dbh -> prepare($sql); $sth->bindparam(':p_id', $_GET["p"], PDO::PARAM_INT); $sth ->execute(); $pimages = $sth -> fetchAll(); $footerjs=" "; $file=basename($_SERVER['PHP_SELF']); $file=explode('.',$file); require "tpl/".$file[0].".tpl.php"; require "footer.php"; ?>