Ive created the following variable in one of my scripts if statements which refers to the subsequent function "addModule" which Ive also defined:
$enter = addModule($mCode, $mTitle, $studNums, isset($lectures));
/Please note $lectures is a variable from a checkbox (boolean value) I have in a form and is the value I am struggling to store in my database
/
function addModule( $CODE, $TITLE, $STUD, $LEC) {
/ DB connection details here /
$mQuery = "INSERT INTO module ( module_code, module_title, num_of_students, lectures) VALUES('$CODE','$TITLE','$STUD','$LEC')";
pg_query($link, $mQuery);
}//end function
Can anyone please help? I'm not sure if I'm using isset() in the correct place, but I do want to use it as I want to store in my DB whether the box has been checked or not. Obviously, the datatype for this field in my DB is boolean, which is why im using isset() to test if its checked or not.
Thanks a lot.