my problem is that i cant seem to call any kind of information that is stored in my database. I want to call everything in the order that it is in the database(name of the product, image and price. Here is the code for my index.php Here you can view how my webpage looks so far: screenshot Here you can view the data that is in my database screenshot 2
<!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="http://ift.tt/1sVfO9G">
<link href="http://ift.tt/2Bteqjt" 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="http://ift.tt/2eBd7UN"></script>
</head>
<body>
<header>
<?php
include('head.php');
?>
</header>
<div id="undr">
<img class="bdimg" src="bg.jpg">
</div>
<div id="lowrbdy">
<?php
$select_query="";
$sql = mysqli_query($mysqli,'SELECT * FROM `product`');
while ($row = $sql->fetch_row())
{
?>
<a href="view.php?product=<?=$row["id"]?>">
<div class="outer">
<div class="imgdv"><img src="carrillo/imeg/<?=$row["pro_image"]?>"/></div>
</div>
</a>
<?php
}
?>
</div>
</body>
</html>
Aucun commentaire:
Enregistrer un commentaire