I'm trying to use checkboxes to display and update records in a MySQL database. I want to change the value of the checkbox based on whether it's checked or unchecked. But I'm getting this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
Here's the line of code that's throwing the error:
echo"<input type='checkbox' name='PLJan' {if (isset($_POST['PLJan'])) print 'value='checked''} $row->PLJan /> January ";
Is there a better way for me to do this so that saving it will update the database with 'checked' if the box is checked, and a blank if the box is unchecked?
Thanks in advance for the halps.