Hi I have the following code in my change.php page:
$con = mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("FACT", $con);
if($_POST['isChecked']==1) // SEE THIS LINE PLEASE
{
mysql_query("UPDATE Orc SET CON = 'CHECKED'
WHERE UID = '1'");
}
else
{
mysql_query("UPDATE Orc SET CON = 'NO'
WHERE UID = '1'");
}
mysql_close($con);
This page is called from my index.php wich uses jquery and:
$.post("test.php", { isChecked:$('#checkbox_id').attr('checked') } );
It works almost fine for deslecting the checkbox I still need to manually refresh the page for the change take place in the DB and I cant change the box back to selected...
Im stumped on this one, please help.
Thank you.