Home >Backend Development >PHP Tutorial > 在这基础上加入分页和添加,该怎么解决

在这基础上加入分页和添加,该怎么解决

WBOY
WBOYOriginal
2016-06-13 13:42:59864browse

在这基础上加入分页和添加

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<?php echo '<form action="#" method="get">';
echo '<input type="text" name="keyword" size="35">';
echo '<input type="submit" value="搜         索">';
echo '';
if(isset($_GET['keyword'])){
$_GET['keyword'] = isset($_GET['keyword']) && $_GET['keyword']!='' ? $_GET['keyword'] : '';
$sql = 'select products_id,products_name from products_description where products_name like "%'.$_GET[keyword].'%" or products_id like "%'.$_GET[keyword].'%"';
$query = mysql_query($sql);

echo '
'; echo ''; while($row = mysql_fetch_array($query)){ echo ''; echo ''; } echo '
id name 套餐选项 添加
'.$row['products_id'].''.$row['products_name'].'
'; } ?>

数据库直接就连上了不用在去写数据库链接代码,求指导在这基础上实现搜索之后显示是分页的,而且后面的添加功能也能把查询出来的添加到数据库中。
添加的效果就是要达到这样 
表名:Popularity
products_id Popularity_id(套餐选项中的值)
97 2
1008 1
40 3


------解决方案--------------------
首先分页的,就去下载个分页类就能实现了。
------解决方案--------------------
http://www.baidu.com/s?wd=php+%B7%D6%D2%B3%C0%E0&rsv_bp=0&rsv_spt=3&inputT=5832
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn