<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*" session="true"%> Honslo ki Udaan


<% String category = null; Boolean bool = true ; try{ // Connection con = connect.getConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from t_category where active='1'"); while (rs.next() ) { category = rs.getString(2); if(bool){ out.println("
"); bool = false; } else{ out.println("
"); bool = true; } out.println("

"+category+" »

") ; out.println("Image Not Found"); Statement stmt1 = con.createStatement(); ResultSet rs1 = stmt1.executeQuery("select * from t_news where view = 'General' and category = '"+category+"' and active='1' order by sno desc"); int i = 0 ; while (i!=6 ) { boolean b = rs1.next(); if(b==false) {break;} i++; String str = rs1.getString(2); if (str.length() >= 50 ) { str = str.substring(0, 50); } out.println(""+str+"
"); } rs1.close(); stmt1.close(); out.println("
"); if(bool){ out.println("
"); } } rs.close(); stmt.close(); // con.close(); } catch (Exception e) { out.println(e); } %>

Featured Stories

    <% try { // Featured Srories Update // Connection con = connect.getConnection(); Statement stmt = con.createStatement(); Statement stmt1 = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from t_news where view = 'Featured Stories' and active='1' order by sno desc"); int i = 0 ; while (i!=3 ) { boolean b = rs.next(); if(b==false) {break;} i++; String str = rs.getString(3); // full news // if (str.length() >= 150 ) // { // str = str.substring(0, 150); // divided to 150 characters only // } // i++; out.println("
  • "); out.println("

    "+rs.getString(2)+"

    "); out.println("

    "+str+"

    "); out.println("

    Continue Reading »

    "); out.println("
  • "); } rs.close(); stmt.close(); con.close(); } catch (Exception e) { out.println(e); } %>