使用PHP获取表中的多个值

时间:2018-10-27 15:17:31

标签: php mysql html-table

我是PHP的初学者。我有一张桌子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

}

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

0 个答案:

没有答案