php 传值的有关问题 求高手

WBOY
Release: 2016-06-13 10:16:17
Original
760 people have browsed it

php 传值的问题 求高手


 
   
 
 
 
 
 

 
 
 
 
 
/*连接数据库*/
$conn=mysql_connect("localhost","root","111");
mysql_select_db("register",$conn);
mysql_query("set names utf8");
$arr=mysql_query("select * from luntan",$conn);
/*使用while语句循环mysql_fetch_array()函数返回的数组*/
while($result=mysql_fetch_array($arr)){
?>
 
 
 
 
 
  } //结束while循环
?>
 
标题
作者
发布时间
">
   
 

   
 

   
 


我要在http://localhost/wosheji/lantan/clc.php?id= 6这个页面怎么看到id=6对应着的“内容”?

------解决方案--------------------
PHP code
....................连接数据库代码省略.............$result=mysql_query("select * from 表名 where id=$_GET['id']");$arr=mysql_fetch_assoc($result); print_r($arr);<br><font color="#e78608">------解决方案--------------------</font><br>在http://localhost/wosheji/lantan/clc.php?id= 6页面中加入<br>if(!empty($_GET)){<br> print_r($_GET);<br>}<br>看看输出什么,如果有id值,那么在if的表达式中加入#1的内容<div class="clear">
                 
              
              
        
            </div>
Copy after login
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