Home > Backend Development > PHP Tutorial > php mysql解决方法

php mysql解决方法

WBOY
Release: 2016-06-13 12:04:45
Original
992 people have browsed it

php mysql
这只是查询出表的数据,显示在li标签中,如何使得点击每条数据就跳转到另外页面查看详细信息?求助!


  • ------解决方案--------------------
    你是要把每天记录做个链接吗?那你把a标签放到循环里面来,比如:
    <br /><li><br />	<ul class="topnews-ul"><br />		<li><br />			<?php<br />			$link=MySQL_connect('localhost','root','pqm4YAqGt7jx7jhn'); <br />			?><br />			<?php<br />			mysql_select_db('php_db'); <br />			mysql_query('set names utf8');<br />			$query="select * from table1 where id<=6";<br /><br />			$result= mysql_query($query);//获取数据集<br />			while($rows=mysql_fetch_array($result))<br />			{<br />			?><br />			<a href="case_cats.php?id=<?php echo  $rows['id'];?>" title=""><p name="rowID" style="display:none;"><?php echo $rows['name'] ?></p></a><br />			<?php<br />			}<br />			?><br />		</li><br />	</ul><br /></li> <br />
    Copy after login

    ------解决方案--------------------
    至于怎么显示html内容,自己调整下,以上只是示例
    Related labels:
    source:php.cn
    Statement of this Website
    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
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template