My problem is this
I have a database that stores int value in row "status" that I want to represent certain order status:
0 = submitted
1 = delivered etc.
What I want to achieve is displaying certain text like in the example above instead of int value
My code for displaying whole list is
require 'database_connection.php';
$select_orders = "SELECT username, status, product1_num, product2_num FROM orders";
$result = mysql_query($select_orders);
<ol class="order_list">
<?php while ($order = mysql_fetch_array($result)) {
$order_row = sprintf("<li class='single_order %s'>
<ul>
<li class='username'>%s</li>
<li class='status'>%s</li>
<li class='product'>%s</li>
<li class='product'>%s</li>
</ul>
</li>",
$order['status'], $order['username'], $order['status'], $order['product2_num'], $order['product1_num']);
echo $order_row;
}
?>
</ol>
I tried using if statement inside sprintf but with no success.
Does anyone has any idea how to change displayed code here from
<li class="status">3</li>
to
<li class="status">Delivered</li>
?