-
Notifications
You must be signed in to change notification settings - Fork 1
/
addinlistjava.jsp
26 lines (24 loc) · 1.17 KB
/
addinlistjava.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%
int ShowID = Integer.parseInt(request.getParameter("id"));
int score = Integer.parseInt(request.getParameter("score"));
int progress = Integer.parseInt(request.getParameter("progress"));
String status = request.getParameter("status");
String User = (String) session.getAttribute("theName");
%>
<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/MYANIMELISTBORN"
user="root" password="I'm insane"/>
<sql:query dataSource="${snapshot}" var="UserID">
select * from User where Email = '<%= User%>';
</sql:query>
<c:forEach var="row" items="${UserID.rows}">
<sql:update dataSource="${snapshot}" var="selectQ">
insert into Listed(User_ID,Show_ID,Status,Score,Progress)
values (${row.User_ID}, <%= ShowID%>, '<%= status%>',<%= score%>,<%= progress%>);
</sql:update>
</c:forEach>
<c:redirect url="profilepage.jsp"></c:redirect>