1
it wasn’t for lack of trying but I’m having problems with something I think can be considered simple. Well the project is a site right? It will be a goods query site and only. I have created a product registration page. Register
$host = "localhost";
$user = "root";
$pass = "";
$banco = "produtos";
$conexao = mysql_connect($host, $user, $pass);
mysql_select_db($banco) or die(mysql_error());
$nome=$_POST['nome'];
$especificacoes=$_POST['especificacoes'];
$preco=$_POST['preco'];
$url=$_POST['url'];
$sql = mysql_query("INSERT INTO cadastro(nome,especificacoes,preco,url)
VALUES('$nome', '$especificacoes','$preco','$url')");
echo "feito";
In this page the registration is being done successfully. However I do not know how to display it by ID(Note that every registered product has auto incrementing ID), I would like to display these images in little squares in the code.
<div class="thumbnail"><!--Centraliza a imagem dentro do box-->
<img src="Aqui seria a imagem cadastrada" alt="ibagem">
<div class="caption"><!--Esta div cria o que esta escrito abaixo da imagem-->
<h3 align="Center">Aqui o nome cadastrado do produto</h3>
<p align="center">E aqui as especificações cadastradas do produto</p>
<p align="center"> <a href="produtos.html" class="btn btn-default" role="button">Especificações</a></p>
But I have no idea how to do this or how to get ID 1 to appear next to ID 2 next to ID 3, if anyone can help me I would really appreciate it.
And I’m sorry if I’m posting wrong, or if this question has already been answered, but I can’t find and after almost two months of searching and only finding solutions like external programs (like wordpress), I didn’t know where else to turn.
You already have a query that inserts the data, now you need one to get the values...
SELECT
, and then awhile
... I won’t be able to post anything now, if no one does it on the way back I do... What is the name of the column that contains theIDs
?– MagicHat
The column name is id
– SrFenix
I was able to use select ... I’m just not able to turn the url into an image... And now I’m in the while business. From what I understand I’m going to put while id > x ai I’m going to do id++ something like vlw by north guy.
– SrFenix