-1
Following guys, I have a database with some items and display the items of this database using this model:
<?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 take the values typed in that input and send to a next page, so that I can manipulate itlos, and save again in another database, example:
Take all the data typed in the INPUT of all the displayed items, along with the user ID that is in $_SESSION and store them in another Logs database, for when in the user’s Logs page display the amount of each item that he requested.
Is that possible in PHP? How would you do that? And excuse me, guys, I’m still learning, bear with me!
You can use the
$_SESSION
or go through the URL withGET
seusite.com?a=teste&b=teste2...
– rbz