Yeah, having the status names in an associated table with the status IDs as a foreign key in the main_data table would be a better approach, but this should work with what you have:
$counts = array(
'In Progress' => 0,
'Order Received' => 0,
'Waiting for Artwork' => 0,
'Waiting for Approval' => 0,
'Complete' => 0,
'On Hold' => 0
);
$query = "SELECT status, COUNT(Status) as count FROM main_data GROUP BY status";
$result = mysql_query($query) or die(mysql_error());
while($record = mysql_fetch_assoc($result))
{
$counts[$record['status']] = $record['count'];
}
$output = "<table>\n";
$output .= " <tr><th colspan=\"4\">CURRENT STATUS REPORT</th></tr>\n";
$record = 0;
foreach ($counts as $status => $value)
{
$record++;
if ($record%2==1)
{
$output .= " <tr>\n";
}
$output .= " <td>{$status}</td>\n";
$output .= " <td>{$value}</td>\n";
if ($record%2==0)
{
$output .= " </tr>\n";
}
}
$output = "</table>\n";
echo $output;