<%@ page contentType="text/html; charset=ISO-8859-1" language="java" import="java.sql.*" %> <% Connection conn=null; String classPath = "org.gjt.mm.mysql.Driver"; try{ conn = DriverManager.getConnection("jdbc:mysql://localhost/daphne?user=daphne&password=cool^doc!"); //out.print("Connection established
"); } catch(Exception exc) { out.print(exc.toString()); } Statement stm=null; ResultSet rst=null; stm=conn.createStatement(); String query = "SELECT * FROM forum GROUP BY thread_id ORDER BY thread_id DESC"; rst = stm.executeQuery(query); %> Daphne Stevens:::Interactive Forum



daphne's home page
life coaching
on-line therapy and other services
mental health issues
dream work
Workshops
therapeutic approaches
Living Well newsletter and Articles
On-line Interaction
On-line resources
articles and tapes
about daphne stevens
contact daphne stevens
View Archives
Search Archives  


<% int i=0; String strThreadID = ""; while(rst.next()) { i++; %> <% if (i==1) { break; } } %>
Title Posted By Date
<% strThreadID = (String) rst.getString("thread_id"); %><% String strTitle = (String)rst.getString("title"); out.print(strTitle); %> <%= rst.getString("name") %> <% String strDate = (String)rst.getString("date"); String strYear = strDate.substring(0,4); String strMonth = strDate.substring(4,6); String strDay = strDate.substring(6,8); out.print(strMonth+"/"+strDay+"/"+strYear); %>

<%= rst.getString("message") %>

Reply to this message

<% try{ conn = DriverManager.getConnection("jdbc:mysql://localhost/daphne?user=daphne&password=cool^doc!"); //out.print("Connection established
"); } catch(Exception exc) { out.print(exc.toString()); } stm=null; rst=null; stm=conn.createStatement(); String query2 = "SELECT * FROM forum WHERE thread_id="+strThreadID+" ORDER BY message_id ASC"; rst = stm.executeQuery(query2); int J=0; while(rst.next()) { J++; if (J==1) { } else{ %>
Reply By <%= rst.getString("name") %> Date <% String strDate = (String)rst.getString("date"); String strYear = strDate.substring(0,4); String strMonth = strDate.substring(4,6); String strDay = strDate.substring(6,8); out.print(strMonth+"/"+strDay+"/"+strYear); %>

<%= rst.getString("message") %>

&thread_id=<%= rst.getString("thread_id") %>">Reply to this message

<% } } %>

 


Contents of this website are protected by ©Copyright 2000-2006 Daphne Stevens, Ph.D. All rights reserved.