Bonsoir,
Je voudrais de l'aide pour une requête.
insert into table(nom_pdf,service_id,direstion_id) select nom_pdf,id,id from pdf,service,direction where nom_pdf=? and pdf.service_id= ??
J'ai 3 tables pdf,service,direction. "service_id" et "direction_id" sont des clé étrangère dans table pdf.
J'ai créé un formulaire
- nom-pdf
- service
- direction
Comme des champs du formulaire.
Ce que je veut est retirer id de service choisis
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>pdf</title>
</head>
<body>
<center>
<h1>stoker fichier</h1>
<form method="post" action="uploadServlet" enctype="multipart/form-data">
<table border="0">
<tr>
<td>nom_pdf: </td>
<td><input type="text" name="nom" size="50"/></td>
</tr>
<tr>
<td> Service</td>
<td> <select name="service">
<option> ser1</option>
<option> ser2</option>
</select></td>
</tr>
<tr>
<td> direction</td>
<td> <select name="direction">
<option> dir</option>
<option> dir2</option>
</select></td>
</tr>
<tr>
<tr>
<td>pdf: </td>
<td><input type="file" name="photo" size="50"/></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Save">
</td>
</tr>
</table>
</form>
</center>
</body>
</html> |
Par exemple je veux retirer id de nom de service pour le stoker dans table pdf comme clé étrangère merci d'avance.
Partager