Maison >développement back-end >tutoriel php >php如何实现 数据库存放网页相对路径 搜索后结果显示是一个链接
php数据库
<code> //PHP模糊查询技术 $sql="select * from preinfo where prename like '%{$keywords}%'"; $res=mysql_query($sql); $prename=array(); //用于保存查询到的药方 if(!empty($keywords)){ while($row=mysql_fetch_assoc($res)){ $prename[]=$row; } } //print_r($prename); if($keywords){ echo'<h3>查询关键字<font color="red">'.$keywords.'</font>的结果为:</h3>'; } if($prename) { echo'<table align="center" width="500" border="1" cellpadding="5"> '; echo'<tr> <th>药方名</th> <th>所属目次</th> <th>操作</th> </tr>'; //循环输出查询结果 foreach($prename as $key=>$value){ $murl=$value['content']; echo'<tr>'; echo'<td>'.$value['prename'].'</td>'; echo'<td>'.$value['caname'].'</td>'; echo '<td>' <a href="<?php%20echo%20%24murl;%20?>>%20%E6%9F%A5%E7%9C%8B</a>%20'</td>';%20%20%20%20%20%20%20%20%20%20%20%20echo'</tr>';%20%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20echo'</table>';%20%20%20%20%20%7D%E7%82%B9%E5%87%BB%E6%9F%A5%E7%9C%8B%EF%BC%8C%E4%BC%9A%E8%B7%B3%E8%BD%AC%E5%88%B0%E7%9B%B8%E5%BA%94%E9%A1%B5%E9%9D%A2%EF%BC%8C%E8%AF%B7%E9%97%AE%E4%BB%A3%E7%A0%81%E6%94%B9%E5%A6%82%E4%BD%95%E4%BF%AE%E6%94%B9%EF%BC%9F%20%20%20%20echo%20'<td>'%20<a%20href=" echo>> 查看</a> '</td>'; 这句代码显示错误,请问该如何解决?求大神们帮忙解答!!!! </tr> </table></code>