我想根据结账页面的页面 ID 获取值。我怎样才能获取它???
我有 3 个按钮,它们的 id 进入一个页面,顺便说一句,它们是三个不同的表数据。
<a href="chekout.php?v=<?= $total_row['gfx_id'];?>" ">Buy Now</a>
<a href="chekout.php?v=<?= $total_row['frontend_id'];?>" >Buy Now</a>
<a href="chekout.php?v=<?= $total_row['backend_id'];?>" >Buy Now</a>
现在我想将他们的 id 数据获取到我的结账页面。我刚刚成功获取了一个表数据,就是它`
$id=$_GET['v'];
$sel="SELECT * FROM gfx WHERE gfx_id='$id' ";
$qri_res=mysqli_query($con,$sel);`
如何获取另外 2 个数据?
最佳答案
发送其他参数
<a href="chekout.php?v=<?= $total_row['gfx_id'];?>&flag=1" ">Buy Now</a>
<a href="chekout.php?v=<?= $total_row['frontend_id'];?>&flag=2" >Buy Now</a>
<a href="chekout.php?v=<?= $total_row['backend_id'];?>&flag=3" >Buy Now</a>
并获取flag变量并根据flag进行查询。
关于php - 我想根据页面 ID 从多个表中获取数据到我的结账页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44277448/