【发布时间】:2015-04-07 10:31:28
【问题描述】:
我正在用 PHP 做一个用于视频流的小型项目。我在哪里完成了所有编码,但我被困在 UI 中。我应该显示所有视频及其名称和图片。我可以使用“echo”轻松显示所有名称,但如何使用 HTML 脚本显示图片?
这是我出错的程序部分
enter code here
<?php
$query = mysql_query("SELECT * FROM `video`");
?>
while($row = mysql_fetch_assoc($query))
{
$id = $row['id'];
$name = $row['name'];
echo "<a href='watch.php?id=$id'>$name</a><br />";
}
<div class="wrapper col4">
<div id="container">
<div class="gallery">
<h2>Gallery Category Title</h2>
<ul>
while($row = mysql_fetch_assoc($query))
{<?php
$id = $row['id'];
$imag = $row['img'];
$name = $row['name'];
<li><a rel="prettyPhoto[gallery1]" href="$imag.jpeg" title="Image 2"> <img src="$imag.jpeg" alt="Title Text" /> </a>
<a href= 'watch.php?id=$id'> '$name' </a> </li></br>
echo "<a href='watch.php?id=$id'>$name</a><br />";
?>
【问题讨论】:
-
什么样的视频..?来自在线资源或本地存储...?