我有數據庫鏈接無法使用
綠色標誌去一個問題,旁邊的圖片是爲了訪問保存在我的數據庫中的促銷活動現場。但它會在新選項卡中加載相同的頁面。
我對這個代碼是:
<a href="<?php echo $data['promo_link']; ?>" target="_blank"><img alt="" title="" src="GO.png" height="50" width="50" align="right" /></a>
任何想法,爲什麼它不工作?
如果您需要我的任何頁面的任何代碼,請讓我知道,我會編輯並添加它。
謝謝。
如何將我的圖像保存到鏈接保存在 promo_link 在我的數據庫表?
<?php
include_once('include/connection.php');
include_once('include/article.php');
$article = new article;
**if(isset($_GET['id'])) {
$id = $_GET['id'];
$data = $article->fetch_data($id);**
$articles = $article->fetch_all();
?>
<html>
<head>
<title>xclo mobi</title>
<link rel="stylesheet" href="other.css" />
</head>
<body>
<?php include_once('header.php'); ?>
<div class="container">
<a href="index.php" id="logo">Category = ???</a>
<?php foreach ($articles as $article) {
if ($article['promo_cat'] === $_GET['id']) { ?>
<div class="border">
<a href="single.php?id=<?php echo $article['promo_title']; ?>" style="text-decoration: none">
<img src="<?php echo $article['promo_image']; ?>" border="0" class="img" align="left"><br />
**<a href="<?php echo $data['promo_link']; ?>" target="_blank"><img alt="" title="" src="GO.png" height="50" width="50" align="right" /></a>**
<br /><br /><br /><br />
<font class="title"><em><center><?php echo $article['promo_title']; ?></center></em></font>
<br /><br />
<font class="content"><em><center><?php echo $article['promo_content']; ?></center></em></font>
</div><br/><br />
</a>
<?php } } } ?>
</div>
<?php include_once('footer.php'); ?>
</body>
</html>
這是我對於只有代碼。這是[鏈接]上的下載鏈接相同的代碼(http://www.xclo.co.uk/mobile/appdonate/article.php?id=1) – kevstarlive
那麼我怎麼可以將我的圖像href我的圖像數據庫字段? – kevstarlive
找到您要賦予$ data ['promo_link']參數值的位置。看看那裏出了什麼問題。 –