使用php在表中获取多个值

xytpbqjk  于 2021-06-18  发布在  Mysql
关注(0)|答案(0)|浏览(214)

我是php初学者。我有一张table No, Date, FileName, FileSize, Attachment Code, FileLink, Share . 我只要按一下分享按钮,下面会有一个框。给它一个邮件id,我只需点击共享按钮。所以,我的问题是点击任何传递相同id的共享按钮。。我的代码在这里:

<form>
    <?php
         include "connect.php" ;

    $attchquery= mysql_query("select * from eduploads order by id desc limit 5") ;

    echo "<table style='width:100%' class='table'>" ;
echo "<tr>" ;
echo "<th>No</th><th>Date</th><th>File Name</th><th>FileSize</th><th>Attachemnt Code</th><th>File Link</th><th>Share</th>" ;
echo "</tr>" ;

$count = 0 ;

while ($row = mysql_fetch_array($attchquery)) {
$count++ ;
echo "<tr>" ;
echo "<td>",$count,"</td><td>",$row['filedate'],"</td><td>",
$row['filename'].".".$row['fileext'],"</td><td>",
$row['filesize'],"</td><td>",$row['fileid'],"</td><td>",
"<a href='".$valueres['settingsvalue'],$row['filelink']."'>Download</a></td><td>",
"<input type='hidden' value='".$row['fileaddname']."' name='emailvaluepass'><input type='submit' value='Share' name='singlemailshare' class='btn btn-primary'></td>" ;

echo "</tr>" ;

}

echo "</table>" ;

    ?>

<input type='text' name='singleemail' required>
</form>

// get value

if(isset($_POST['singlemailshare']))
{
echo $single_email_sharing = $_POST['singleemail'] ;
echo $single_email_id = $_POST['emailvaluepass'] ;  // Only get last value

}

如何解决我的问题?你能给我举个好例子吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题