<?php
include 'load.php'; 
$sql = "SELECT * FROM temp_purchase_order";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
  while($row = $result->fetch_assoc()) { 
	$tot = $row["price"] * $row["qty"];
    $product_id = $row['product_id'];
		$prodductinfo = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM mobileproducts WHERE prid='$product_id'"));
		$tid = $row['temp_purchase_order_id'];
		echo '<tr>
			<td>'.$prodductinfo['proname'].'</td>
			<td>'.$row["qty"].'</td>
            <td>'.$prodductinfo["price"].'</td>
			 <td>'.$tot.'</td>
			<td><button onclick="remove('.$tid.')"  class="btn btn-block btn-outline-danger active btn-sm text-white remove"><i class="fa fa-trash" data-bs-toggle="tooltip" title="" data-bs-original-title="fa fa-trash" aria-label="fa fa-trash"></i></button></td>
    	</tr>';
 }
} ?>