1
Contributor
1
Reply
6
Views
1 Year
Discussion Span
Last Post by Prashant_9
0
<%@page import="java.sql.*"%>
<html>
    <body>



        <select name="combo">        
            <option value="1">railway</option> 
            <option value="2">railway station</option> 

        </select> 


    <tr>                      
        <%
            String name = request.getParameter("combo");

            String sq = "select * from vehicle where ride_add='" + name + "'";

            Class.forName("com.mysql.jdbc.Driver");
            Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/auto", "root", "123456");

            Statement sta = con.createStatement();
            ResultSet ra = sta.executeQuery(sq);
            while (ra.next()) {
        %>                       

        <td><%=ra.getString(1)%></td>
        <td><%=ra.getString(2)%></td>
        <td><%=ra.getString(4)%></td>
        <td><%=ra.getString(5)%></td>


        <%
            }

        %>                       
    </tr>   
</body>




</html>

Edited by Prashant_9

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.