动态超链接数据库ID未显示

时间:2013-11-29 08:17:13

标签: php mysql dynamic hyperlink

好的,所以我有一个网站,显示以电子商务网站通常格式列出的数据库中的产品,除了图像外,一切都显示出来,并且动态超链接上的ID号不会出现到产品页面以显示其所有信息(即使它将在页面上显示为文本,证明其被检索)。

我的问题是我的身份证号码不会出现在动态超链接中,而且我一直在重新检查拼写错误和我的数据库等等,并且一直试图找到治疗这个问题好几个小时没有运气。

我想我的问题是,有人可以帮我解释为什么id没有显示在超链接中吗?

的index.php:

$result = mysql_query("SELECT * FROM product WHERE catagory='accessories' ORDER BY productId DESC LIMIT 8");

while($column = mysql_fetch_array($result)){
    echo "<section class='product'>
              <section class='productImg'>
                  <a target='_self' href='fullProductInfo.php?productId='" . $column['productId'] . "'>
                      <img src='images/products/" . $column['productImg'] . "' width='180' height='150' />
                  </a>
              </section>
              <section class='productName'>" . $column['productName'] . "</section>
              <section class='productPrice'>" . $column['productPrice'] . "</section>
          </section>";
}
mysql_close($con);

它应该在这里,但不是。

fullProductInfo.php

$productId=$_GET['productId'];
$result = mysql_query("SELECT * FROM product WHERE productId='$productId'");

    echo "<section class='productNameFull'><h2>" . $result['productName'] . "</h2></section>";
    echo "<section class='productImgFull'><img src='images/products/" . $result['productImg'] . "' width='250' height='250' /></section>";
    echo "<section class='productPriceFull'><h1>" . $result['productPrice'] . "</h1></section>";
    echo "<section class='shortDescFull'><strong>Description</strong><br />" . $result['shortDesc'] . "</section>";
    echo "<section class='longDescFull'><strong>Features</strong><br />" . $result['longDesc'] . "</section>";
    echo "<section class='catagoryFull'><strong>Catagory:</strong> " . $result['catagory'] . " > " . $result['subCat'] . "</section>";
    echo "<section class='brandFull'><strong>Brand:</strong> " . $result['brand'] . "</section>";

mysql_close($con);

这不起作用,因为我不是以表格形式做的,不会这么想,但仍然,最好问一下!

0 个答案:

没有答案