I currently have a homepage set up with a table including array query for fetching table row's of data, I've tested PhpToPDF and TCPDF but i've ran in to the issue of me not knowing what to do, my array limiting my options of sending data accross but the array is reliant on when user log's in, that their login username gives the query the information criteria required to fetch from db. I've also come accross the issue of the webpage being hosted on localhost. Can anyone demonstrate how to convert the table onto a pdf document when Create PDF is clicked? Prefabably free solutions
$query = "select * from orders where userid= ' $userid' order by orderid";
$result = mysqli_query($db,$query);
if ($result){
while ($rows = mysqli_fetch_array($result))
{
?>
<tr>
<td> <?php echo $rows[4]; ?> </td>
<td> <?php echo $rows[0]; ?> </td>
<td> <?php echo $rows[1]; ?> </td>
<td> <?php echo $rows[2]; ?> </td>
<td> <?php echo $rows[3]; ?> </td>
<td>
<a href ="deleteorderhomepage.php?receiptid=<?php echo $rows[3]?>&orderid=<?php echo $rows[0]?>">Delete </a>
</td>
</tr>
<?php
if(isset($_POST["create_pdf"])) { }
}
}
?
</table>
</br>
<input type="submit" name="create_pdf" value="Create PDF" />
</div>
</div>
</body>
</html>