如何以表格(水平)显示数据库的多个图像。 [英] How to show multiple images of database in a form (Horizontally).

查看:60
本文介绍了如何以表格(水平)显示数据库的多个图像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我有图像存储在数据库和文件夹中,我想从搜索查询中逐个以横向格式显示这些图像。

我能够显示垂直格式,但如果你们有任何想法,我无法弄清楚如何做到这一点请帮助我。



i只需图片(信息不是强制性的)。



这是我的代码



 <   center  >  
< table width = 910 border = 0 cellspacing = 0 cellpadding = 3 样式 = 颜色:#303030; font-family:Verdana,Arial,Helvetica,sans-serif;字体大小:11像素;行高:18像素; text-align:left; >
< tr bgcolor = #e5e5e5 >
< td colspan = 5 class = mainname > < span class = 有效 > < strong <搜索结果< / strong > < / span > < / td < span class =code-keyword>>
< / tr >
< tr >
< td >
<? php

if(isset($ _ POST ['Search']))

{

/ * echo < script > alert('hello')< / script > ; * /
$ gender = $ _ POST ['gender'];
$ agemin = $ _ POST ['agemin'];
$ agemax = $ _ POST ['agemax'];
$ hmin = $ _ POST ['hmin'];
$ hmax = $ _ POST ['hmax'];
$ religion = $ _ POST ['religion'];
$ marital_status = $ _ POST ['marital_status'];
$ city = $ _ POST ['city'];
$ state = $ _ POST ['state'];
$ country = $ _ POST ['country'];
include(db.php);

$ query_for_result = mysql_query(select * from matri_user_info where(gender ='$ gender')and(age agemin $ $ agemax)和(hmin与$ hmax之间的高度)和(宗教信仰) ='$ religion')和(marital_status ='$ marital_status')和(city ='$ city')和(state ='$ state')和(country ='$ country'););

// $ query_for_result = mysql_query(select * from matri_user_info where(gender ='$ gender'););

$ num = mysql_num_rows($ query_for_result);
echo < << end

< table align = right >
< tr >
< ; td bgcolor < span class =code-keyword> = #6fa34f style = font-family:Verdana,Arial,Helvet ica,sans-serif;字体大小:12像素;填充:5px 5px 5px 5px;颜色:#FFFFFF; > 总结果搜索< / td > < td > & nbsp;& nbsp; < / td > < td bgcolor = #044396 style = font-family:Verdana,Arial,Helvetica,sans-serif;字体大小:12像素;填充:5px 5px 5px 5px;颜色:#FFFFFF; > $ num < / td >
< / tr >
< / table >
end;
mysql_close();
?> ;

< div style = height:500px;溢出:scroll; overflow-x:hidden;宽度:910px; >
< table width = 910 cellspacing = 0 cellpadding = 10 样式 = font-family:Verdana,Arial,Helvetica,sans-serif;字体大小:11像素;颜色:#000000;背景:#f3f3f3;填充:1px 1px 10px 1px; text-align:left; >
< tr style = font-size:12px; text-align:left; >

< td bgcolor = #CCCCCC > 照片< / td >
< td bgcolor = #CCCCCC > 名称< / td > ;
< td bgcolor = #CCCCCC > 宗教< / td < span class =code-keyword>>
< td bgcolor = #CCCCCC > 城市< / td >
< td bgcolor = #CCCCCC > < / td >
< td bgcolor = #CCCCCC > 电子邮件< / td > ;

< / tr >
<! - < / table> - >
< ; php

$ i = 0;

while ($ i < $ num)

{





$ f3 = mysql_result($ query_for_result,$ i, candi_pic_1);

$ f4 = mysql_result($ query_for_result,$ i, name);

$ f5 = mysql_result($ query_for_result ,$ i, religion);

$ f6 = mysql_result($ query_for_result,$ i, city);

$ f7 = mysql_result($ query_for_result,$ i, state);

$ f8 = mysql_result( $ query_for_result,$ i, email_id);



>
< tr valign = top >
< td style = border-bottom:#cdcdcd solid; border-bottom-width:1px; > <? php echo < img src =' pic /\".$ f3。' height =' 120' width =' 100' > ;?> < < span class =code-leadattribute> / td
>
< td style = border-bottom:#cdcdcd solid; border-bottom-width:1px; > <? php echo $ f4; > < / td >
< td < span class =code-attribute>
style = border-bottom:#cdcdcd solid; border-bottom-width:1px; > <? php echo $ f5; > < / td >
< td < span class =code-attribute> style = border-bottom:#cdcdcd solid; border-bottom-width:1px; > <? php echo $ f6; > < / td >
< td < span class =code-attribute> style = border-bottom:#cdcdcd solid; border-bottom-width:1px; > <? php echo $ f7; > < / td >
< td < span class =code-attribute> style = border-bottom:#cdcdcd solid; border-bottom-width:1px; > <? php echo $ f8; > < / td >

< / tr >
<? php

$ i ++;



}

}

else { < span class =code-summarycomment>

echo < script > alert( 未找到数据)< / script > ;
}
?> < / table > < / div >
< / td >
< / tr > < / table >
< / center >





还有一个我的查询不适合搜索,所以如果你们中的任何人有任何想法相关的婚姻网站serch代码比pls分享那个。



谢谢

解决方

_POST ['Search']))

{

/ * echo <脚本 > alert('hello')< / script > ; * /


gender =


_POST [ '性别'];

Hi friends,

I have images stored in database and in a folder and i want to show these images in Horizontal format one by one from a search query.
I am able to show vertical format,But i am not able to figure out how to do this if any of you have any idea then pls help me out.

i only need images(information is not compulsory).

This my code

<center>
<table width="910" border="0" cellspacing="0"  cellpadding="3" style="color:#303030; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; line-height:18px; text-align:left;">
<tr bgcolor="#e5e5e5">
<td colspan="5" class="mainname"><span class="active"><strong>Search Result</strong></span></td>
</tr>
<tr>
<td>
<?php

if(isset($_POST['Search']))

{

/*echo "<script> alert('hello')</script>";*/
$gender=$_POST['gender'];
$agemin=$_POST['agemin'];
$agemax=$_POST['agemax'];
$hmin=$_POST['hmin'];
$hmax=$_POST['hmax'];
$religion=$_POST['religion'];
$marital_status=$_POST['marital_status'];
$city=$_POST['city'];
$state=$_POST['state'];
$country=$_POST['country'];
 include("db.php");

$query_for_result=mysql_query("select * from matri_user_info where (gender='$gender') and (age between $agemin and $agemax) and (height between $hmin and $hmax) and (religion='$religion') and (marital_status='$marital_status') and (city ='$city') and (state='$state') and (country='$country');");

//$query_for_result=mysql_query("select * from matri_user_info where (gender='$gender');");

$num=mysql_num_rows($query_for_result);
echo <<<end

<table align="right" >
<tr>
<td bgcolor="#6fa34f" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:5px 5px 5px 5px; color:#FFFFFF;" >Total Result Search</td><td>&nbsp;&nbsp; </td><td bgcolor="#044396"  style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:5px 5px 5px 5px; color:#FFFFFF;">$num</td>
</tr>
</table>
end;
mysql_close();
?>

<div style=" height:500px;overflow: scroll;overflow-x:hidden; width:910px; ">
<table width="910"   cellspacing="0" cellpadding="10"   style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; color:#000000; background:#f3f3f3; padding:1px 1px 10px 1px; text-align:left;">
<tr style="font-size:12px; text-align:left;">

<td bgcolor="#CCCCCC">Photo</td>
<td bgcolor="#CCCCCC">Name</td>
<td bgcolor="#CCCCCC">Religion</td>
<td bgcolor="#CCCCCC">Cities</td>
<td bgcolor="#CCCCCC">State</td>
<td bgcolor="#CCCCCC">E-Mail</td>

</tr>
<!--</table>-->
<?php

$i=0;

while ($i < $num)

 {





$f3=mysql_result($query_for_result,$i,"candi_pic_1");

$f4=mysql_result($query_for_result,$i,"name");

$f5=mysql_result($query_for_result,$i,"religion");

$f6=mysql_result($query_for_result,$i,"city");

$f7=mysql_result($query_for_result,$i,"state");

$f8=mysql_result($query_for_result,$i,"email_id");



?>
<tr valign="top"  >
<td style="border-bottom:#cdcdcd solid; border-bottom-width:1px;"><?php echo "<img src='pic/".$f3."' height='120' width='100'>";?></td>
<td style="border-bottom:#cdcdcd solid; border-bottom-width:1px;"><?php echo $f4; ?></td>
<td style="border-bottom:#cdcdcd solid; border-bottom-width:1px;"><?php echo $f5; ?></td>
<td style="border-bottom:#cdcdcd solid; border-bottom-width:1px;"><?php echo $f6; ?></td>
<td style="border-bottom:#cdcdcd solid; border-bottom-width:1px;"><?php echo $f7; ?></td>
<td style="border-bottom:#cdcdcd solid; border-bottom-width:1px;"><?php echo $f8; ?></td>

</tr>
<?php

$i++;



}

}

else {

echo "<script> alert('No Data Found')</script>";
}
?></table></div>
</td>
</tr></table>
</center>



One more thind my query is not appropriate to search so if any of you have any idea related matrimonial website serch code than pls share that too.

thanks

解决方案

_POST['Search'])) { /*echo "<script> alert('hello')</script>";*/


gender=


_POST['gender'];


这篇关于如何以表格(水平)显示数据库的多个图像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆