This question already has an answer here:
I have a series of input fields and checkboxes. One of which is this:
<input type="checkbox" class="checkbox_style" <?php if($rows1['make_up'] == 'Yes') {echo 'checked';} ?> name="make_up" id="make_up" value="yes" />
It is sent to a php script which defines the variable:
if (!empty($_POST['make_up'])){$make_up = "Yes";} else {$make_up = "No”;}
Then it should update accordingly.
$updatesql = ("UPDATE $table_name SET
brazilian_waxing='$brazilian_waxing',
hollywood_waxing='$hollywood_waxing',
reflexology='$reflexology',
indian_head_massage='$indian_head_massage',
weight_loss_wraps='$weight_loss_wraps',
body_exfoliation='$body_exfoliation',
back_treatments='$back_treatments',
eyelash_extension='$eyelash_extension',
nail_enhancements='$nail_enhancements',
eyelash_lift='$eyelash_lift',
eyebrow_extension='$eyebrow_extension',
make_up='$make_up'
WHERE id='$user_id' LIMIT 1");
if (mysqli_query($link, $updatesql)) {
$_SESSION['username'] = $username_check;
header('Location: ../../admin');
} else {
echo "Error: " . $updatesql . "<br>" . mysqli_error($link);
}
mysqli_close($link);
I have 30+ others on the same script that all work fine but this one just wont update. Can anyone see a reason for this?
Thank you in advance for your help.
</div>