如何更改此代码,以便它一次只显示一个图像,并带有下一个和上一个按钮以浏览图像。在php中使用next/prev按钮在sql中显示图像
I used the code from this website
$sql = "select * from people";
$result = mysql_query($sql) or die ("Could not access DB: " . mysql_error());
while ($row = mysql_fetch_assoc($result))
{
echo "<div class=\"picture\">";
echo "<p>";
// Note that we are building our src string using the filename from the database
echo "<img src=\"images/" . $row['filename'] . "\" alt=\"\" /><br />";
echo $row['fname'] . " " . $row['lname'] . "<br />";
echo "</p>";
echo "</div>";
如果没有人愿意帮助,他们可以点我的教程或网站,可能有答案的方向。我是新来的PHP,所以所有的帮助非常感谢。
你用什么来显示图像?灯箱? – lusketeer 2012-07-14 22:48:51
我希望学习如何在代码中调整图像大小,而不是诉诸于lightbox这是它目前的样子:goawaymom.com/test2/images.php – uneducatedguy 2012-07-14 23:08:54
你只是想在页面或整个画廊上展示一张图片,并使用灯箱浏览它们? – lusketeer 2012-07-14 23:13:06