Next, I have a database with some items and I display the items in this database using this template:
<?php $conexao = mysqli_connect("Host","User","Pass","banco");
if( !$conexao ){
echo "Erooooou.";
exit;
}
$sql = "SELECT * FROM produtos ORDER BY id DESC";
$consulta = mysqli_query($conexao, $sql);
if( !$consulta ){
echo "Erro ao realizar consulta. Tente outra vez.";
exit;
}
while( $dados = mysqli_fetch_assoc($consulta) ){
$imagem = $dados['imagem'];
echo "<div class='shop1'>";
echo "<img src='$imagem'>";
echo "<div><p>" .$dados['nome']. "</p></div>";
echo "<div><p>" .$dados['valor']. "</p></div>";
echo "<input type='number' name'quantidade'>";
echo "</div>"; }?>
This code is taking all the data from my bank and displaying, each one in a cute div, until then everything beauty, business is that I wanted to get the values typed in that input and send to a next page, so that I you can manipulate them, and save it again in another database, for example:
Get all data entered in the INPUT of all displayed items, along with the user ID that is in $ _SESSION and save them in another Logs database, so that when the User Logs page displays the quantity of each item he ordered.
Is this possible in PHP? How would you do that? And excuse me guys, I'm still learning, have patience with me!