php出租房数据管理及搜索页面
php数据访问例子:租房信息管理,具体内容如下 1.数据库建表 2. zufangzi.php <div class="jb51code"> 租房子<form action="zufangzi.php" method="post"> 区域:全选 $sqy = "select distinct area from house";//写SQL语句,并去重$aqy = $db->query($sqy); foreach($aqy as $v) { echo "{$v[0]}"; } ?> 租赁类型:全选 query($szl); foreach($azl as $v) { echo "{$v[0]}"; } ?> 房屋类型:全选 query($sfw); foreach($afw as $v) { echo "{$v[0]}"; } ?> 关键字: <table width="100%" border="1" cellpadding="0" cellspacing="0"> $tj1 = " 1=1 "; if(!empty($_POST["qy"]))
} if(!empty($_POST["zl"]))
} if(!empty($_POST["fw"]))
} if(!empty($_POST["key"])) $sql = "select * from house where {$tj1} and {$tj2} and {$tj3} and {$tj4}"; $arr = $db->query($sql); |