I am saving numerous values to a database.
and would like some thoughts, if I have
<input type="checkbox" name="foo" value="true">
then when I save the value of foo, should it save true if its "ticked"?
Also when I reload the variables, if the value I saved was true I want to make it checked, do I need to use an if else statement along these lines:
if($myVar=="true"){
echo"<input type="checkbox" name="foo" checked value="true">";
}else{
echo "<input type="checkbox" name="foo" value="true">";
}
or is there another way?
Also what type should I use in my database, im currently using varchar(5) and passing true or false, is there a boolean type affair I could use?
I would appreciate any enlightenment I can become.
Its tough being nOOb.
Thanks for any help!
Taff