difficulties in submitting listbox values to DB

Joined
Aug 3, 2007
Messages
2
Reaction score
0
Hello All,

I am having difficulties while submitting the listbox values which is being selected by the user to the DB.

The problem is that it is only inserting one value and ignores the other values.

((The whole thing I am doing is in one jsp))

The code is described below:
HTML:
String name=request.getParameter("name"); 
String address= request.getParameter("address"); 
String username=request.getParameter("username");     
query= insert into users values (name,address,usename) values (???)  
ps.setString(1,user); 
ps.setString(2,address); 
ps.setString(3,username);

The name and the address are text boxes and they are inserted properly in the DB, but the usernames are the listed values. When the user is selecting John, Mark, Edd. John will be inserted, but the other will not. Can you please help me with this issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top