Jump to content

Update database by checkboxes


only1perky

Recommended Posts

Hi guys,

 

I'm trying to update my database with a certain number of checkboxes.

At the moment I have this in my form:

 

<input name="mailinglist" type="checkbox" id="mailinglist" value="1" <? if($row_rsdetails['mailinglist'] == 1){ ?> checked="checked" <? } ?>/>

 

This works and updates the database with the value 1 when checked. What I can't figure out is how to update the database with 0 if the box is unchecked.

 

I'm sure this is glaringly obvious but I'm stumped.

 

Cheers.

Link to comment
https://forums.phpfreaks.com/topic/143929-update-database-by-checkboxes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.