请教你一个 php问题
我图片 信息已经存入数据库
我现在要做一个图片展示
有分页 的
并且 可以按照 图片 的 信息进行搜索
图片信息有姓名 年龄 等 搜索 的时候按照这些条件精确或者模糊查询
怎么弄
有例子最好
我图片 信息已经存入数据库
我现在要做一个图片展示
有分页 的
并且 可以按照 图片 的 信息进行搜索
图片信息有姓名 年龄 等 搜索 的时候按照这些条件精确或者模糊查询
怎么弄
有例子最好
<dl>
<dt></dt>
<dd>售后商品搜索</dd>
<dd><input type="text" name="articlekey"/></dd>
<dd><input type="submit" value="搜索" /></dd>
<dt class="end"></dt>
</dl>
</form>-------------------------------------------
$results=mysql_query("select article from article order by date desc limit 0,21");$pagesize=13;
if(isset($_GET['page'])){
$page=$_GET['page'];
if($page<0 || empty($page) || !is_numeric($page)){
$page=1;
}else{
if($page>1){
$page=intval($page);
}else{
$page=1;
}
}
}else{
$page=1;
}
//上面分页if($_GET['action']=='searcharticle'){
$num=mysql_num_rows(mysql_query("select id from dingdan
where name in (select name from article where article='{$_POST[articlekey]}' )
and id in (select did from article where article='{$_POST[articlekey]}' ) "));
if($num==0){
$pagenum=1;
}else{
$pagenum=ceil($num/$pagesize);
} $pageopen=($page-1)*$pagesize;
$result=mysql_query("select * from dingdan where name in (select name from article where article='{$_POST[articlekey]}')
and id in (select did from article where article='{$_POST[articlekey]}' )
order by date desc limit $pageopen,$pagesize");}//上面找数据信息
<div id="indexright">
<h2>最新销售记录</h2>
<table>
<tr><th>姓名</th><th>金额</th><th>支付方式</th><th>时间</th></tr>
<?php while(!!$rows=mysql_fetch_array($result,MYSQL_ASSOC)){
$html=array();
$html['id']=$rows['id'];
$html['name']=$rows['name'];
$html['money']=$rows['money'];
$html['bank']=$rows['bank'];
$html['date']=$rows['date'];
?>
<tr><td><a href="content.php?id=<?php echo$html['id'] ?>"><?php echo $html['name']?></a></td><td><?php echo $html['money']?></td><td><?php echo $html['bank']?></td><td><?php echo $html['date']?></td></tr>
<?php }?>
</table>
<ul>
<li><?php echo $page?>/<?php echo $pagenum?>页 | </li>
<li> 共有<?php echo $num ?>条数据 | </li>
<?php if ($page==1){?>
<li> 首页 | </li>
<li> 上一页 | </li>
<?php }else{?>
<li> <a href="look.php">首页</a> | </li>
<li> <a href="look.php?page=<?php echo $page-1?>">上一页</a> | </li>
<?php }?>
<?php if($page==$pagenum){?>
<li> 下一页 | </li>
<li> 尾页</li>
<?php }else{?>
<li> <a href="look.php?page=<?php echo $page+1?>">下一页</a> | </li>
<li> <a href="look.php?page=<?php echo $pagenum?>">尾页</a></li>
<?php }?>
</ul>
</div>//输出数据信息,并分页!
/* Table: phplz_imageResume */
/*==============================================================*/
create table phplz_imageResume
(
id int not null,
title varchar(255) not null,
fileurl varchar(255),
createdate datetime,
imagename varchar(255),
name varchar(255),
age int,
worktime int,
edu int,
wantjob int,
primary key (id)
);
上面是表结构 //连数据库。
$hostname_myconn = "localhost";
$database_myconn = "test";
$username_myconn = "root";
$password_myconn = ""; 可以根据 name varchar(255),
age int,
worktime int,
edu int,
这三个条件精确搜索,
根据wantjob int,
模糊查询 就是 '%wantjob%' 这种
/* Table: phplz_imageResume */
/*==============================================================*/
create table phplz_imageResume
(
id int not null,
title varchar(255) not null,
fileurl varchar(255),
createdate datetime,
imagename varchar(255),
name varchar(255),
age int,
worktime int,
edu int,
wantjob int,
primary key (id)
);
上面是表结构 //连数据库。
$hostname_myconn = "localhost";
$database_myconn = "test";
$username_myconn = "root";
$password_myconn = ""; 可以根据
name varchar(255),
age int,
worktime int,
edu int,
这四个条件精确搜索,
根据wantjob int,
模糊查询 就是 '%wantjob%' 这种