我有一个旧数据库要维护....他们已经在数据库中存储了 html 标签,并且正在使用旧的 mysql 和 php 来获取输出...现在我正在尝试通过函数和 PDO 使用它来获取输出....没有得到正确的输出....它只是给html标签显示格式化段落...我该如何解决它,这是我的代码-->功能
function movie_page($name,$date){
global $host, $dbname, $user, $pass;
$DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
$STH = $DBH->prepare("SELECT * FROM bh_movies WHERE name = ? and re_date = ?");
$STH->bindValue(1, "$name", PDO::PARAM_STR);
$STH->bindValue(2, "$date", PDO::PARAM_STR);
$STH->execute();
$STH->setFetchMode(PDO::FETCH_ASSOC);
return $STH;
}
输出是
$STH = movie_page($id,$date);
while (($row = $STH->fetch()) !== false) {
if ($row['actors'] !=''){
echo '<tr>
<td><h1><a href="movie_page.php?id='.$row['name'].'">'.$row['name'].'</a></h1></td>
<td>'.date('d-M-Y',$row['re_date']).'</td>
<td><a href="movie_page.php?id='.$row['name'].'">
<img src="'.$row['small_poster'].'" title="'.$row['name'].'" alt="'.$row['name'].'" height="97" width="182"/>
</a>
</td>
<td><a href="movie_page.php?id='.$row['a'].'">
<td>'.$row['actors'].'</td>
<td>'.$row['small_desc'].'</td>
<td>'.$row['big_desc'].'</td>
</tr>';
}
我在输出中得到 Html 标签......而不是像这样的格式段落
<font color="green"><B><u>Characters</u></B></font><br><br> <B>Sonu Dilli (KKC)</B> Emraan Hashmi<BR><BR> Sonu Dilli is a streetsmart
请帮忙
* 输入源*
function insert_data(){
global $host, $dbname, $user, $pass;
$DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
$STH = $DBH->prepare("INSERT IGNORE INTO bh_movies
(name, bh_link, re_date, small_poster, big_poster, small_desc, big_desc, actors)
value (:name, :bh_link, :re_date, :small_poster, :big_poster, :small_desc, :big_desc, :actors)");
return $STH;
}