This is a search function that pulls information depending on search criteria and prints it in a table. Also I have a few different pages for different restaurants that I want to open depending on what dish i click on. Basically, when I click on the href I want it to recognize which specific restaurant it is and take me there.
This is my code:
<%
String value=request.getParameter("search");
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection("**************", "******", "*******");
Statement st=conn.createStatement();
ResultSet rs = st.executeQuery("SELECT menu.name, menu.info, menu.price, restaurants.name from menu,"
+ " restaurants where restaurants_restaurantID=RestaurantID AND (menu.name like '%"
+ value
+ "%' "
+ "or menu.info like '%"
+ value
+ "%' or menu.category like '%"
+ value
+ "%' "
+ "or menu.kitchen like '%"
+ value
+ "%' or quick_choose like '%" + value + "%')");
%>
<table>
<tr class="head">
<td>Name:</td>
<td>Info:</td>
<td>Price:</td>
<td>Restaurant:</td>
<td>Location:</td>
</tr>
<%
while (rs.next()){
%>
<tr class="content">
<td class="name"><%=rs.getString("name")%></td>
<td class="info"><%=rs.getString("info")%></td>
<td class="price"><%=rs.getInt("price")%></td>
<td class="restaurant"><%=rs.getString("restaurants.name")%></td>
<td class="location"><a href="#" %>>Show</a>
</tr>
<%
}
%>
</table>
<%conn.close();%>
</div>