i want to give the option called comments for each article and i want that to store in mysql database i have created two table "artkle" and "comnts "
how do i make the respective comments to display for that specific article using php.
the link is here see this you'll get some idea
http://shadows.sit.ac.in/hungama/index.php
so that you can help me.
threads help
Moderator: General Moderators
What you want to have is relational tables e.g
articles table
========
ID
ART_TITLE
ART_TEXT
ART_AUTHOR
DATA:
1 | ART TITLE | ART TEXT | AUTHOR
2 | ART TITLE | ART TEXT | AUTHOR
3 | ART TITLE | ART TEXT | AUTHOR
comments table
==========
ID
ART_ID
COMMENT_TEXT
COMMENT_AUTHOR
DATA:
1 | 1 | COM TEXT | COM AUTHOR
2 | 2 | COM TEXT | COM AUTHOR
3 | 1 | COM TEXT | COM AUTHOR
In the comments table you have a column that references the article table.
So the above data has:
Phirus[/list]
articles table
========
ID
ART_TITLE
ART_TEXT
ART_AUTHOR
DATA:
1 | ART TITLE | ART TEXT | AUTHOR
2 | ART TITLE | ART TEXT | AUTHOR
3 | ART TITLE | ART TEXT | AUTHOR
comments table
==========
ID
ART_ID
COMMENT_TEXT
COMMENT_AUTHOR
DATA:
1 | 1 | COM TEXT | COM AUTHOR
2 | 2 | COM TEXT | COM AUTHOR
3 | 1 | COM TEXT | COM AUTHOR
In the comments table you have a column that references the article table.
So the above data has:
- 2 Comments relating to article 1
- 1 Comment relating to article 2
Phirus[/list]