douejuan9162 2013-03-10 14:46
浏览 14
已采纳

php-mysql页面上没有显示[关闭]

Hi the following is not sowing any thing on the webpage. Where I went wrong?

The following is a link to profile.php
?>
<a href="profile.php?id=<?php echo $id ?>"><?php echo $id;?></a>
<?PHP

======================================= This is the linked php file profile.php

<html>

<body bgcolor='#4c5865'>

<p style="position: absolute ; top: 0; text-align: left><font face="geneva" size='1' color="#ccc"><a href="cbs.php" ><b><font color="white">Home</font></p></a>
<?php

include("db1.php");
$id=$_GET['id'];

$result = $mysql_query ("select agt,dvd FROM agttot where agt='$id'");

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
$ac =$row[0];
$dc =$row[1];
$bc =$row[2];

 //   echo "<tr bgcolor='#a9a9a9'><td align='right'>";
    print $ac;
 //   echo "</td><td align='right'><b>"; 
    print $dc;
}
?>
</body>
</html>
  • 写回答

4条回答 默认 最新

  • duanjing1023 2013-03-10 14:59
    关注

    You didn't add ; after $id in this line:

    <a href="profile.php?id=<?php echo $id ?>"><?php echo $id;?></a>

    mysql_query() is a function (also don't use mysql_* functions anymore, they're deprecated!) so it shouldn't be called with a $ in front here:

    $result = $mysql_query ("select agt,dvd FROM agttot where agt='$id'");

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式