| meshi |
10-15-2007 11:48 AM |
how to make the value of checkbox 1 or 0
PHP Code:
$text_array3 = array( 'Decision Maker' => array (
'name'=> 'dm',
'text'=> 'Decision Maker',
'type'=> 'checkbox',
'value'=> "$row[dm]"
);
'Head Office' => array (
'name'=> 'ho',
'text'=> 'Head Office',
'type'=> 'checkbox',
'value'=>"$row[head_office]"
);
$sql=("insert into table (ho,dm)values($_POST['ho'],$_POST['dm'])"
if i had to insert value of checkbox to mysql ,wat would i add to my code to make the value of check box 1 if check and 0 if unchecked.becoz if i check it the value is 0 and if i unchecke it the value is NULL.how would i do the 1 or 0 value?
|