Php 我不知道如何从回显数据中提取图像ID
让我从一开始就解释一下:Php 我不知道如何从回显数据中提取图像ID,php,html,mysql,mysqli,pdo,Php,Html,Mysql,Mysqli,Pdo,让我从一开始就解释一下: <? $images_query = "SELECT * FROM `tag` "; $images = mysqli_query($conn, $images_query); ?> <div class="col-md-4 thumb panel panel-default " style="margin-bottom:5px;margin-top:5px border-style: solid; bo
<?
$images_query = "SELECT * FROM `tag` ";
$images = mysqli_query($conn, $images_query); ?>
<div class="col-md-4 thumb panel panel-default " style="margin-bottom:5px;margin-top:5px border-style: solid;
border-color: black;">
<a title="<?php echo $row['name'];?>" class="fancybox" href="<?php echo $row['name'];?>" alt="" > <img title="1st title" style="margin-top:12px;" src="<?php echo $row['name'];?>" alt="" ></a>
<div class="panel-heading" style="min-height:48px;">
<div class="col-md-4" data-href="http://etronhosting.com/brain/<? echo $test;?>"> <img class="imgshare2" src="images/dl.png" style="max-height:40px;"></img>
<form method="post">
<input type="submit" value="add" name="fav"/>
</form>
<?
if(isset($_POST['fav'])){
$sq = "INSERT INTO `favourites` (`name`)
SELECT `name` from `tag`";
$insert=mysqli_query($conn,$sq );}?>
</div>
<div class="fb-share-button col-md-4" data-href="http://etronhosting.com/brain/<? echo $row['name'];?>" data-layout="button_count"> </div>
<div class="col-md-4">
</div>
</div>
</div>
您的代码喜欢数据库中的所有内容,这是毫无意义的。你需要在表单中嵌入你喜欢的任何东西的ID作为隐藏字段。e、 g.@MarcB这是我的主要问题,我该如何拔出它?$id\u i\u need=你没有“拔出”——你已经有了它。只需将它添加到您的db查询中,即可在第一时间生成列表。@MarcB是的,您击中了正确的位置,tnx很多!但我不知道如何将你的评论标记为答案。