日期:2014-05-17 浏览次数:20409 次
<?php echo '<form action="#" method="get">'; echo '<input type="text" name="keyword"size="35" />'; echo '<input type="submit" value="搜 索" />'; echo '</form>'; 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 '<table width="500" border="1">'; echo '<tr><td>id</td><td>name</td><td>套餐选项</td><td>添加</td></tr>'; while($row = mysql_fetch_array($query)){ echo '<tr><td>'.$row['products_id'].'</td>'; echo '<td>'.$row['products_name'].'</td><td><select name="select"><option>1</option><option>2</option><option>3</option><option>4</option></select></td><td><input type="submit" value="添加"/></td></tr>'; } echo '</table>'; } ?>