Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当我悬停使用php连接到mysql的图像时显示标题_Php_Javascript_Mysql_Lightbox - Fatal编程技术网

当我悬停使用php连接到mysql的图像时显示标题

当我悬停使用php连接到mysql的图像时显示标题,php,javascript,mysql,lightbox,Php,Javascript,Mysql,Lightbox,我想在将鼠标悬停在使用php连接到mysql的图像上时显示图像标题 这是我使用的代码 <div class="galleryko"> <?php $data = mysql_query("SELECT * FROM tbl_gallery_featured")?> <div class="lalagyan1"> <?php while($row = mysql_fetch_assoc($data)):?> <

我想在将鼠标悬停在使用php连接到mysql的图像上时显示图像标题

这是我使用的代码

<div class="galleryko">
<?php $data = mysql_query("SELECT * FROM tbl_gallery_featured")?>

    <div class="lalagyan1">
    <?php while($row = mysql_fetch_assoc($data)):?>
        <div class="lalagyan">
            <div id="wew">
                <a href="admin/featured/<?php echo $row['photo']?>" rel="lightbox[plants]"><img src="admin/featured/<?php echo $row['photo']?>" style="width:150px; height: 150px;"/></a></br>                      
            </div>
        </div>
    <?php endwhile?>  
    </div>   
</div>  


然后我尝试在代码中插入一个标题

<a href="admin/featured/<?php echo $row['photo']?>" rel="lightbox[plants]" title="SOMETEXT"><img src="admin/featured/<?php echo $row['photo']?>" style="width:150px; height: 150px;"/></a></br>

但是当我把图片悬停在上面的时候,发生的事情是,所有的图片都有一些文字,现在我想分别显示图片的标题

请找个人解决我的问题,。先谢谢你!:)

删除
title=“SOMETEXT”
并将类似内容添加到
img
tag
alt=“$row['title']”


好吧,上面说的“SOMETEXT”非常直白。。。您几乎没有将其编码到title=标记中。只需使用数据库列(如果存在)就可以了(并且正确地使用alt/title)如何放置一些标题?在图像中插入这些标题的位置,我已经将代码alt=$row['title']”放在了哪里,但是当我悬停图像或单击图像时,没有发生任何事情,没有标题或文本。这可能无助于回答您的问题,但您应该停止使用
mysql.*
函数。它们已被弃用。请改用(从PHP 5.1开始支持)或(从PHP 4.1开始支持)。如果您不确定要使用哪一个,您的意思是:您想单独显示图像的标题吗?我如何放置一些标题?在图像中插入这些标题的位置,我已经将代码alt=$row['TITLE']”放在了哪里。但是当我悬停图像或单击图像时,没有发生任何事情,没有标题或一些文本。
<a href="admin/featured/<?php echo $row['photo']?>" rel="lightbox[plants]" title="<?php echo $row['title']?>"><img src="admin/featured/<?php echo $row['photo']?>" style="width:150px; height: 150px;"/></a>