M
matt
I have a page that has a section to enter info into a db and list the
people on the same page. When I click on the person, I would like to
reload their info back into the form.
Isn't there a way to set the formfields equal to the resultset that
comes back? I have a link on the name that sends the id of the row in
the db to retrieve their info and allow me to update it.
I'd also like to change the button, but that's not a big deal.
tried this:
Enumeration parameters = request.getParameterNames();
if (parameters.hasMoreElements()){
if( null != idMain && !idMain.equals( "" ) ){
if (action.equals("edit")){
if( null != idMain && !idMain.equals( "" ) ){
Statement stmnt1 = conn.createStatement();
ResultSet editQuery =
stmnt1.executeQuery("select
first_Name,last_Name,belt,sex,age,weight from competitor where
id="+idMain);
while(editQuery.next()){
fName = editQuery.getString("first_Name");
lName = editQuery.getString("last_name");
b = editQuery.getInt("belt");
s = editQuery.getString("sex");
a = editQuery.getInt("age");
w = editQuery.getInt("weight");
}
}
}
}
<tr>
<td>
First name:
</td>
<td>
<input type="Text" name="first_name" value=<%=fName%>>
</td>
</tr>
But if I pick another name, the fName field doesn't change. I think I
have the right intention, just some serious problems in syntax
Thanks for any advice!
M@
people on the same page. When I click on the person, I would like to
reload their info back into the form.
Isn't there a way to set the formfields equal to the resultset that
comes back? I have a link on the name that sends the id of the row in
the db to retrieve their info and allow me to update it.
I'd also like to change the button, but that's not a big deal.
tried this:
Enumeration parameters = request.getParameterNames();
if (parameters.hasMoreElements()){
if( null != idMain && !idMain.equals( "" ) ){
if (action.equals("edit")){
if( null != idMain && !idMain.equals( "" ) ){
Statement stmnt1 = conn.createStatement();
ResultSet editQuery =
stmnt1.executeQuery("select
first_Name,last_Name,belt,sex,age,weight from competitor where
id="+idMain);
while(editQuery.next()){
fName = editQuery.getString("first_Name");
lName = editQuery.getString("last_name");
b = editQuery.getInt("belt");
s = editQuery.getString("sex");
a = editQuery.getInt("age");
w = editQuery.getInt("weight");
}
}
}
}
<tr>
<td>
First name:
</td>
<td>
<input type="Text" name="first_name" value=<%=fName%>>
</td>
</tr>
But if I pick another name, the fName field doesn't change. I think I
have the right intention, just some serious problems in syntax
Thanks for any advice!
M@