<table border='5'>
<tr>
<th>
Номер Заказа
</th>
<th>
Дата Заказа
</th>
<th>
Сумма Заказа (руб.)
</th>
<th>
Статус
</th>
</tr>
<?php while ($order = $order_result->fetch_assoc()): ?>
<tr>
<td>
<?php echo htmlspecialchars($order['id']); ?>
</td>
<td>
<?php echo htmlspecialchars($order['order_date']); ?>
</td>
<td>
<?php echo htmlspecialchars($order['total']); ?>
</td>
<td>
<?php echo htmlspecialchars($order['status_cart']); ?>
</td>
</tr>
<?php endwhile; ?>
</table>
<?php
if ($result->num_rows > 0)$order['status_cart'] == . $row["firstname"]);
<a type="aaa" href='index.php'>Оплатить</a>
<?php endif; ?>"/>
if ($result->num_rows > 0 && $order['status_cart'] == 'Ожидает оплаты')
{
// do something
}