-2
I have this code below.
<?php
include '../conexao.php';
$sth = $pdo->prepare('SELECT * FROM comanda');
$sth->execute();
?>
<?php
foreach ($sth as $res) {
extract($res);
?>
<center>
<ul>
<a href="#.php"><img id="efeito" src="../img/<?= $num_com ?>.png"></a>
</ul>
</center>
<?php
}
?>
here the code line with the "href" brings a data from the bank and uses in the $num_com.
I need to make sure that when I select a command(image) it takes the specific value of the variable and stores in another to be used in an Index in the future.
how can I do this ?
thanks in advance for the attention.
Thanks for the tip, but I couldn’t execute. , when clicking on an image, the value of the image is directed to another pg and stored in a variable. ali como você me disse, I would need name for each image to make it work, there I basically made an array and made it display the images until reaching the last number available in the bank
– joaohd15
You can pass value using: <a href="pageRecebevalor? value=142"> <img src="camiodaimg.png"> </a>
– marcos vinicius Mulinari
has worked well, thank you very much for the attention and the tip. success and happiness to you.
– joaohd15
Don’t forget to check to show others how to solve the problem <3 until next time.
– marcos vinicius Mulinari