• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Secret to inserting records from html form?????

 
Carol Murphy
village idiot
Bartender
Posts: 1202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a secret command to use when inserting a record into a database from a html form? I have been working on JDBC2 from the cattle drive, and for some reason I can't get all of data from my form into the table in the database. There are 3 types of input fields, and they are working properly because I can print out the user input to teh web page, but for some reason only the input from the text fields and radio buttons are being inserted into the database.
My table is set up with 6 columns. The 4 that work are varchar() of different lengths. The 2 that don't work are char(1). I tried changing them to varchar(). Didn't work.
I'm using statement.update( "INSERT INTO MYTABLE VALUES ( '"+variable1+"' , '"+variable2+"' , etc))"
The syntax is the same for all 6 columns, and all 6 columns are being passed an appropriate value, but mysql can't seem to insert the whole row into the table.
HELP!!!
I'm starting to obsess over this!
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show more of your code? Are you getting a SQLException on the INSERT or are just ending up with null values in some of your db fields?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is a Cattle Drive question, I'm moving it there just in case someone accidentally solves it.
Dave
 
Michael Matola
whippersnapper
Ranch Hand
Posts: 1817
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the original thread for my working theory on what's going wrong.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic