So I have a bit of code that upon submit of a page (a page that has a simple checkbox on it with a value of “1”) should update a record in the database to reflect that the checkbox was checked by the website user.
if($_POST){
$cr = ($_POST["agree"] == 1)? 1:0;
$res = mysql_query("update mytable set useragreed='$cr' where id='$_ARTICLE[id]'");
I program in other languages, so I’m confident I understand what’s going on here.
The one thing I don’t understand is what the “1:0” at the end of the second line is doing.
Basically for some reason the database is not being updated, and I’m trying to troubleshoot as to why.