Closed Thread Icon

Topic awaiting preservation: update and display multiple records (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12977" title="Pages that link to Topic awaiting preservation: update and display multiple records (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: update and display multiple records <span class="small">(Page 1 of 1)</span>\

 
Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 11-12-2003 07:40

Hi!

I have a question which I have not been able to find a solution. I really appreciate your input. Thank you.

I have a table

mytable
----------
userid,
team [The team could only have 3 possible values (ie 1,2,3 with default 1)]

I would want to display [ user id - Team] combination in a table, with the team showing the existing value from database using "SELECT and OPTION" or "INPUT Radio button combination in 3 columns".

I would like to be able to make the changes and have an update button to update all the records with the new value.

How do I do this in JSP?

Thank you.


jiblet
Paranoid (IV) Inmate

From: Minneapolis, MN, USA
Insane since: May 2000

posted posted 11-12-2003 17:57

I don't know JSP, but I suspect anyone who answers will want to know what kind of database you have.

-jiblet

Rhino
Bipolar (III) Inmate

From: New Jersey, USA
Insane since: Jul 2003

posted posted 11-12-2003 20:03

There are numerous ways you can handle this, but it would be helpful to see what you have so far so we can get a better idea.

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 11-12-2003 23:11

I am using MySQL and JSP. I have the database connection all working properly, but not able to proceed this requirement.

If I have just 1 item to update, then I could use a single INPUT Radio button or Option. But with multiple user_id, I am not sure how to handle the SQL update. Thank you.


----------------- This is where I am so far --------


<FORM name=myform METHOD="post" ACTION="<%= request.getRequestURI() %>">

<input class="buttons" type="submit" value="Change Group" name="action">
<input class="buttons" type="Reset">
<p>


<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="1" WIDTH="100%">
<TR><TH VALIGN="MIDDLE">Team No</TH>
<TH VALIGN="MIDDLE"> User ID</TH>
</TR>

<%
String sql = "SELECT * FROM MYTABLE " ;
ResultSet cset = CM.executeQuery(sql);

while (cset.next()){
%>

<TR BGCOLOR=#FFFFFF><TD>

???

</TD><TD>
<%= cset.getString("USER_ID") %>
</TD></TR>
<% }
%>


</TABLE>

« BackwardsOnwards »

Show Forum Drop Down Menu