这是PHP代码:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$dbname = 'moviefone';
$con = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname, $con);
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$data = mysql_query("SELECT * FROM new_hindi LIMIT 4") or die(mysql_error()); $info = NULL;
while($row = mysql_fetch_array( $data ))
{
$info = $row ;
};
?>
和 HTML:
<div class="sub-column1">
<a class="new_movies" href="#"><span>New</span></a> <a href="#"><img src=
"%3C?php%20echo%20$info[">" width="140" height="200" class="new-img"
/></a> <a class="img_titles" href="#"><?php echo $info["title"];?></a>
<a class="new_english" href="#"><span>New</span></a>
</div>
我无法显示图像和标题。它没有显示错误,但图像是空白的。