Dispose of database products

Need help because I need to have the products I have in my database on the product page.

Follows an image to demonstrate where I want to insert insert the description of the image here

Author: José Gomes, 2018-06-18

2 answers

You should do so

<?php
$db=mysqli_connect(bla, bla, bla, bla); //Campos da ligação
$query=mysqli_query($db, "SELECT * FROM tabela"); //Caso use mysqli
while($mostra=mysqli_fetch_assoc($query)){ //Caso use mysqli
?>
<img src="src da pasta da imagem/<?=$mostra['imagem']; ?>" />
<span><?=$mostra['nome']; ?></span>
<?php
}
?>

With this you have the essentials and you will have to make the css as you wish.

 1
Author: I_like_trains, 2018-06-18 09:10:24

I would suggest that you start by trying to make an HTML and CSS that looks like the final image, before you even make PHP (I assume it is), when you are happy with the look, you start working PHP to get the products and make the dynamic list. Small steps.

By doing HTML you are first defining your document structure, getting simpler then doing PHP to make certain parts of that document dynamic, with data coming from the database. give.

Would even suggest that you try this, and you are putting Here problems that you are encountering, if you have not tried something yet, probably the help we are going to give you will still confuse you more or it will not be the best exercise to learn what to do next time.

Something I did when I was learning was copy HTML and CSS from other sites and realize why it was done the way it was.

 0
Author: Leite, 2018-06-18 09:20:43