私の問題は、私のデータベースに格納されている情報を呼び出すことができないということです。私はそれがデータベース内にある順番にすべてを呼びたいと思います(製品名、イメージ、価格の名前です)index.phpのコードはですここで私のウェブページの見た目を見ることができます:私のデータベース(画像のリンクなし)に保存されている画像、テキスト、および番号を呼び出す方法
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Add to Cart</title>
<?php
$mysqli = new mysqli("localhost", "id3764036_alan", "agro12345", "id3764036_agrotienda");
?>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed|Rubik" rel="stylesheet">
<style>
a{text-decoration:none; color:inherit}
#undr{width:100%; height:580px; position:absolute; top:75px; left:0px;}
.bdimg{width:100%; height:100%}
#lowrbdy{ position:absolute; top:90px; left:0px;width:100%; height:100px}
.outer{width:270px; height:270px; background:rgba(255,255,255,0.8); float:left; margin-left:55px; margin-bottom:10px}
.imgdv{width:100px;height:140px;margin:10px auto;}
.imgdv img{width:100%; height:100%}
.pname{ text-align:center; width:100%; height:20px; font-size:15px; margin-top:-14px; margin-bottom:10px}
.prs{ text-align:center; font-size:24px; margin:0px}
.butndv{width:140px; height:40px; margin:auto; margin-top:-10px}
.butn{width:100%; height:100%; background:rgba(78,172,240,1.00); border:none; color:#fff; font-size:18px; border-radius:6px}
.outer:hover{ background:#fff}
.outer:hover .butn{ background:#4A7FDC; transition:all 0.2s ease-in-out; cursor:pointer}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
\t <header>
\t \t <?php
\t \t \t include('head.php');
\t \t ?>
\t </header>
\t \t
<div id="undr">
\t \t <img class="bdimg" src="bg.jpg">
\t </div>
\t
<div id="lowrbdy">
<?php
$select_query="";
$sql = mysqli_query($mysqli,'SELECT * FROM `product`');
while ($row = $sql->fetch_row())
{
?>
\t <a href="view.php?product=<?=$row["id"]?>">
\t <div class="outer">
\t \t <div class="imgdv"><img src="carrillo/imeg/<?=$row["pro_image"]?>"/></div>
\t \t \t </div>
\t \t </a>
<?php
}
?>
\t
</div>
</body>
</html>
あなたはデシベルではない画像にファイル名を格納するのでinstated
mysqli_fetch_assoc
を使用する必要がMySQLiの手続き で試すことができます。.. 'carrillo/imeg /'に実際に画像ファイルがあることを確認してください – nogad画像はhttps://agro-tienda.000webhostapp.com/carrillo/imeg/に保存されています。私が望むのは、自分のDBに新しい情報を追加すると、自動的に新しいページがWebページに生成されるということです。 –