gpt4 book ai didi

php - php 列表中的数据

转载 作者:行者123 更新时间:2023-11-29 19:44:16 25 4
gpt4 key购买 nike

我想让你知道如何从 php 中的列表中获取数据。

<h1>Liste livres</h1>
<ul>
<form method="post" action="">
<?php
$liste = $bdd->query("SELECT * FROM livres");
while($l = $liste->fetch()){
?>
<li><input type="hidden" name="isbn" value="<?php echo $l['livre_isbn']; ?>"/>\<?= $l['livre_titre'] ?>\<?= $l['livre_auteur'] ?>\<?= $l['livre_genre'] ?>\<?= $l['dispo'] ?></li>
<button name="empr" type="submit">Emprunter</button>
<?php } ?>
</form>
</ul>

每次我单击显示的任何元素的“Emprunter”时,他只获取过程中列表的最后一个元素。我如何确保它采用正确的元素?有关信息,列表中使用的元素是 $['livre_isbn']

最佳答案

输入 <form>标签在你的 while循环:-)

关于php - php 列表中的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41146410/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com