This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inserting checkbox in database

 
Deepak Chawla
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a checkbox in the form, i want that when i hit submit, it should insert its information in database. can anyone tell me how to do that.
Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried on your own? What code have you written and where are you having problems?
bear
 
Deepak Chawla
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what i am trying to ask because i know i can insert other fields in database but do i have to create a field in database for that checkbox and also how that field will recognize a check.
ANy sugesstions???
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's up to you to determine how you want to represent a checkbox value in your DB. The key is storing the appropriate value and interpreting the value correctly when it's retrieved from the database to be displayed on the screen. Some people use 1/0, on/off to indicate checked/unchecked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic