In Page 1 that I have the below code:
if($col==1)
{
$OutCtrl=1;
//echo "<a href=webpurchase1.php>Company Name</a> ";
echo "<a href=\"webpurchase1.php?sort=companyname\">Company Name</a> ";
}
Then in Page 2, I have the following:
if($_GET['sort']==companyname)
{
if($sortCompany==0)
{
$query=" SELECT * FROM webpurchases ORDER BY companyname DESC";
$sortCompany=1;
}
else
{
$query=" SELECT * FROM webpurchases ORDER BY companyname ASC ";
$sortCompany=0;
}
$OutCtrl=0;
}
The table is suppose to sort itself alternatively between ASC and DESC everytime I click on the link. However, using echo, I found that the $sortCompany does not have any values at all at the start, not even zero. What does it mean?
Thanks