php?id=如何实现

来源:百度知道 编辑:UC知道 时间:2024/05/09 18:33:49
我的要求很简单
我已经建立二个PHP文件,一个是显示项目标题,
第二个文件是 显示文件内容
如果实现为php?id= 将数据表中的 内容读出来显示在第二个PHP中
同时请明确告诉我 怎么做第一步的链接.
标题链接我是这么写的:<?
$sql="select * from specialitem where assue='baiziyuzhu' order by id desc";
$conn=mysql_query($sql);
$rs=mysql_fetch_array($conn);?>
<a title="<?=$rs[title]?>" href="specialshow.php?id=<?=$rs[id]?>"

target="_blank"><?=$rs[title]?></a> 数据库的链接我已经调用过了 绝对是打开的
我这是单独对一条记录进行测试的

显示内容页面取得编号
$id=request["id"];

$sql="select * from specialitem where id=".$id

:<?
$sql="select * from specialitem where assue='baiziyuzhu' order by id desc";
$conn=mysql_query($sql);
$rs=mysql_fetch_array($conn);
print "<a title='".$rs[title]."' href='specialshow.php?id='".$rs[id]."'target='_blank'></".$rs[title]."></a>";
?>