我已经编写了一个页面,该页面以列表样式显示图像,其中添加了jquery滑块。但是,我需要帮助的是jquery滑块将其识别为图像列表,以便滑块可以工作。任何帮助都将不胜感激。
以下是我的代码:

<div id="slideshow">
                    <ul class="slides">
                    <?php
                        $target = "admin/photogallery/";
                        $getImages = mysql_query("SELECT * FROM photogallery");
                        if(!$getImages) die("Cannot execute query. " . mysql_error());

                        $target = "admin/photogallery/";
                        while($row = mysql_fetch_array($getImages)){
                        if (file_exists($target)) {
                            print '"<li><img src="http://localhost/crystalvirgins/admin/photogallery/'.$row_rsphotogallery['photo'].'" border="0" width="702" alt="'.$row_rsphotogallery['description'].'" /></li>"
                            <div class="clear_3"></div>';
                            $i++;
                        }
                    }?>
                    </ul>
                    <span class="arrow previous"></span>
                    <span class="arrow next"></span>
                </div>

最佳答案

试试这个密码

 <ul>
 <?php
 $directory = "data/uploads/homegallery/";
 if (glob($directory . "*") != false)
 {
 $filecount = count(glob($directory . "*"));
 }
 else
 {
 }
 $files_index = glob("data/uploads/"."home"."gallery/*.*");
 for ($i=0; $i<$filecount; $i++)
{
$num2 = $files_index[$i];
?>
<li><img src="<?php echo $num2;?>" width="650" height="276" alt="" /> <?</li>
}?>
</ul>

关于php - 如何将图像从mysql数据库动态插入php到jquery滑块中,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15299349/

10-11 02:04
查看更多