You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christian Parpart <cp...@t-online.de> on 2001/01/07 22:35:11 UTC

News site with XSP and SQL.

Hi,

my final goal is to create a site where 
people can read news and can give comments.
The first step is done. You can read the news.
To create them and display it to the client
I am using MySQL.

Now my next step is to modify it in that way,
that the clients user can add a comment to a 
news entry or add a comment to a taken comment
from a news entry. Here you're creating a tree
in SQL. That's not the problem, I think.
My problem is, to let them working fine with
XSP a.s.o.

My database record looks like this:

table news (
	ID		bigint unsigned auto imcrement primary key not null,
	ParentID	bigint unsigned not null,
	Date		timestamp not null,
	Author	varchar(40) not null,
	AuthorEMail	varchar(40) not null,
	Title		varchar(80) not null,
	texttype	tinyint not null,
	text		text not null
);

ID is the unique identification number of a 
record(news entry or a comment). ParentID is
either zero, that means it is a news entry,
otherwise it has the ID from its parent,
mayby a news entry or a comment.

This works fine. 

To display all news I can use a simple esql query.
But how can I use that to display its comments and
to display the comments of the comments and so on?

Has anyone any suggestions?

My direct implementation of this can you find at the
attachements.

The sites where I got my impressions have been:
	* http://dot.kde.org
	* http://www.slashdot.org

Thanks

Christian Parpart
SurakWare
cparpart@surakware.com
http://www.surakware.com