PHP & MySQL - inserting checkbox value into database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alexislalas
Forum Commoner
Posts: 44
Joined: Sun Feb 19, 2006 10:09 pm

PHP & MySQL - inserting checkbox value into database

Post by alexislalas »

hello,

i have 31 checkboxes in my registry form. how do i insert the value into the database?

thanks
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

Most simple tutorial is right here:

:arrow: http://www.freewebmasterhelp.com/tutorials/phpmysql/1
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are you talking about the SQL needed, table structure, or the PHP needed to handle the data?
fine
Forum Newbie
Posts: 5
Joined: Thu Oct 13, 2005 4:15 pm

Post by fine »

it is nothing special to deal with checkbox (1, checked, 0 uncheck).

do it like dealing with other php form problems
alexislalas
Forum Commoner
Posts: 44
Joined: Sun Feb 19, 2006 10:09 pm

Post by alexislalas »

what i need is the php to handle the data. how do i insert in the database the 0 or 1, the Y or N. thats the part i dont know.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This depends on your DB field types. Are the fields Tinyint (or Int) or are they Enum("Y","N")?
Post Reply