View Single Post

  #2 (permalink)  
Old 01-08-2005
Janwillem Borleffs
 
Posts: n/a
Default Re: Painful problem for ya :)

RelaxoRy wrote:
> If I untick a checkbox, I want to update the database with "N". an
> unticked checkbox doesnt send anything through $_POST so how do I get
> the change in there?
>


The following would be the easiest:

if (!isset($_POST['holdtalent'])) $_POST['holdtalent'] = 'N';

A nicer approach, however, is to set a default for the table field (alter
table sometable change field field varchar(3) default 'N'). Then you would
only include this field in your query when $_POST['holdtalent'] has been
set...


JW



Reply With Quote