在PHP中的图像绑定 [英] image binding in php
本文介绍了在PHP中的图像绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i我是php新手
现在我正在开展一个项目我想绑定html page.image路径的图像存储在数据库中
i能够在新行中绑定图像,但我想将其显示为3个图像每一行。
所以任何人都会帮助我如何实现
我的代码是下面
包括' database.php中跨度>;
$ query = select * from image_upload;
$ select = mysql_query($ query);
if($ select)
{
echo < table border ='1'align ='center'>< tr>< th width ='150px'height = '50px'align ='center'> Image< / th>< th width ='150px'height ='50px'align ='center'>名称< / th>< th width ='150px'height ='50px'align ='center'>删除< /第>< / TR GT&;跨度>;
while ($ row = mysql_fetch_assoc($ select))
{
$ id = $ row [' id'];
$ url = $ row [' img_url'];
// echo< td width ='150px'height ='100px'align ='center'>;
// echo $ id;
echo < tr>< / td>< td width ='150px'height ='100px'align ='center'>;
echo < img src =' $ url'height ='100p'width ='150px'/>;
echo < / td>< ; td width ='150px'height ='100px'align ='center'>;
echo $ url ;
echo < / td>< ; td width ='150px'height ='100px'align ='center'>;
echo < a href =' delete_edit.php?id = $ id'class ='button'id ='btn_re'>删除< / a>;
echo < / td>< ; / TR GT&;跨度>;
}
echo < ; /表>跨度>;
}
解决方案
查询 = select * from image_upload;
select = mysql_query(
query);
if(
Hii experts
i am new to php
now i am working on one project in that i want to bind images on html page.image path is stored in database
i am able to bind image each in new row but i want to show it as 3 images in each row.
so will any one help me how should it be possible
my code is as below
include 'database.php';
$query = "select * from image_upload";
$select = mysql_query($query);
if($select)
{
echo "<table border='1' align='center'><tr><th width='150px' height='50px' align='center'>Image</th><th width='150px' height='50px' align='center'>Name</th><th width='150px' height='50px' align='center'>Remove</th></tr>";
while ($row = mysql_fetch_assoc($select))
{
$id = $row['id'];
$url=$row['img_url'];
//echo "<td width='150px' height='100px' align='center'>";
//echo $id;
echo "<tr></td><td width='150px' height='100px' align='center'>";
echo "<img src='$url' height='100p' width='150px'/>";
echo "</td><td width='150px' height='100px' align='center'>";
echo $url;
echo "</td><td width='150px' height='100px' align='center'>";
echo "<a href='delete_edit.php?id=$id' class='button' id='btn_re'>Remove</a>";
echo "</td></tr>";
}
echo "</table>";
}
解决方案
query = "select * from image_upload";
select = mysql_query(
query); if(
这篇关于在PHP中的图像绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文