$hresult = mysqli_query("select *,date_format(matchdate,'%D %b %Y') as newmatchdate from fusion_shs_matches where comp ='WCC' or comp like '%CF' or comp like '%PCCF%' or comp like '%GF%' or comp like '%ChF%' or comp like '%JPF%' or comp = 'FTF' or comp = 'PTF' order by matchdate desc");
while ($data = mysqli_fetch_array($hresult))
{
if ($data['attendance']==0) {$data['attendance']='N/R}
if ($data['comp']=='WCC' && $data['season']='1997') {}else {
if ($data['fulltime_saints']>$data['fulltime_opponents'] ) {$data['sw'] = 'W $data['swcolour']="bgcolor=red";}
if ($data['fulltime_saints']==$data['fulltime_opponents'] ) {$data['sw'] = 'D $data['swcolour']="bgcolor=white";}
if ($data['fulltime_saints']<$data['fulltime_opponents'] ) {$data['sw'] = 'L $data['swcolour']="bgcolor=white";}
$compalter=$data['comp'];
$abresult = mysqli_query("select * from shs_abb where current = '$compalter' ");
while ($abdata = mysqli_fetch_array($abresult))
{
$test=$abdata['new'];
echo '