<%-- Document : register Created on : Dec 9, 2013, 12:49:49 PM Author : aqfaridi --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@page import="java.sql.*,connection.Config" %> CodeShare <% String User =(String) session.getAttribute("username"); // out.print(User); if(User != null) {%> <%@include file="header1.jsp" %> <% } else {%> <%@ include file="header.jsp" %> <% } %>
<% String id = request.getParameter("id"); Config c = new Config(); Connection con = c.getcon(); Statement st = con.createStatement(); String qry = "SELECT * FROM askquestions WHERE id='"+id+"'"; ResultSet rs = st.executeQuery(qry); if(rs.next()) { out.println("

"); out.println("Question Title: "+rs.getString("questiontitle")+"
"); out.println("Question Code: " + rs.getString("questioncode")); out.println("


"); out.println(rs.getString("questiondescription")+"
"); out.println("

Asked By : "+rs.getString("username")+" "+rs.getString("time")+"


"); } %>



<% qry = "SELECT * FROM commentquestions WHERE id='"+id+"' ORDER BY Sno DESC"; rs = st.executeQuery(qry); while(rs.next()) { %>

profile <%=rs.getString("username")%> <%=rs.getString("time")%>

<%=rs.getString("comment")%>


<%} if(User!=null) { %>

Leave a Comment


<%} con.close(); %>



<%@include file="footer.jsp" %>