This is a simple serverside ajax script, all I will say about it is that the code in red echoes the values to the page for verification.
Code:
<?php
$conn = mysql_connect("xxx","xxx","xxx");
mysql_select_db("xxx",$conn);
$Name = $_GET["Name"];
$SQL = "Select * From Categories Where Title = '$Name'";
$result = mysql_query($SQL);
$row=mysql_fetch_array($result);
if ($row[2] = "Enabled")
{
$SQL = "Update Categories Set Enable = 'Disabled' Where Title = '$Name'";
}
else
{
$SQL = "Update Categories Set Enable = 'Enabled' Where Title = '$Name'";
}
echo("$row[2], ");
echo($SQL);
mysql_query($SQL);
echo " <table width='100%' border='0'>";
$SQL = "Select * From Categories Order By CategoryID";
$result = mysql_query($SQL);
while($row = mysql_fetch_array($result))
{
echo ("
<tr>
<td width = '160' height = '28'><div class = 'style8' align = 'left'><a href = '#' title = 'Rename Category' onClick = EditCatName('Categories','$row[1]')>$row[1]</a></div></td>
<td width = '80' ><div class = 'style8' align = 'right'><a href = '#' title = 'Enable/Disable' onClick = ToggleCatEnable('Categories','$row[1]')>$row[2]</a></div></td>
</tr>
");
}
echo "</table>";
?>
Please take a look at code then visit the site and see the problem with toggling Enable/Disable, looks like cahed data to me, but I am somewhat new to php.