38 Replies - 3196 Views - Last Post: 16 October 2011 - 08:33 PM
#1
Adding On To My Comment/News System
Posted 15 October 2011 - 12:19 PM
Its pretty simple all made in notepad the past few days. I'm trying to get a news system that can be updated via the website without knowing any code or anything. I have a simple comment system set up for the "news1.php", you can click read more under news1 on the front page to get there. It just inserts the posted information into a table from the form and it is echoed back out there.
I know I may be getting a little bit over my head with this, but I'm up for a challenge.
Basically, I want to know the best way to go about setting up a pretty advanced comment and news system. I want ever news page to have its own comment section - does that require me to have it make a new SQL table for each news section and setting the columns everything automatically... I'd love to try to do this but I have no idea how to start.
Tl;dr I want to put a comment section on every news page created automatically - like the comment section I have on news1.php already.
Feel free to ask me more questions I will stalk this topic.. I probably left a lot out. Hope you understand this!! haha
<3333
Replies To: Adding On To My Comment/News System
#2
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 12:44 PM
newsID
newsTitle
newsContent
newsDate
Comments Table:
commentID
newsID
commentContent
commentDate
Just have a field in the comments table to reference a particular news item. Then when dispaying an item of news, check for any comments with that newsID.
#3
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 12:47 PM
This post has been edited by JackOfAllTrades: 15 October 2011 - 02:22 PM
Reason for edit:: Removed unnecessary quote
#4
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:21 PM
How do I give a table itself an ID that auto increments per every table I make? I can only figure out how to do this with columns. Because I need to link comment table id with news table id.
This post has been edited by JackOfAllTrades: 15 October 2011 - 02:22 PM
Reason for edit:: Removed unnecessary quote
#5
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:23 PM
This post has been edited by CTphpnwb: 15 October 2011 - 01:56 PM
#6
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:32 PM
CTphpnwb, on 15 October 2011 - 01:23 PM, said:
But if its auto incrementing I would only have 1 comment per news section, unless I do like id 1-10... but that would be a random guess.
#7
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:42 PM
#8
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:43 PM
#9
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:45 PM
EDITED; Stated Above -- IGNORE POST --
Ravage, on 15 October 2011 - 10:43 PM, said:
the client will not have to post to a specific news area as the user will enter the comment and your php would input the newsId into the comment table
This post has been edited by Crazy_Learner: 15 October 2011 - 01:44 PM
#10
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:48 PM
Crazy_Learner, on 15 October 2011 - 01:45 PM, said:
EDITED; Stated Above -- IGNORE POST --
Ravage, on 15 October 2011 - 10:43 PM, said:
the client will not have to post to a specific news area as the user will enter the comment and your php would input the newsId into the comment table
I would rather it depend on where the users coming from and be automatic, not manual. Any way to do this?
Ok, I'm still pretty newbie to PHP. Not exactly sure how I would do that. Can you show me? <3
This post has been edited by JackOfAllTrades: 15 October 2011 - 02:24 PM
Reason for edit:: Removed unnecessary quote
#11
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:48 PM
#12
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:48 PM
SELECT commentContent, commentDate FROM Comments WHERE newsID = ? ORDER BY commentID
#13
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:50 PM
CTphpnwb, on 15 October 2011 - 01:48 PM, said:
SELECT commentContent, commentDate FROM Comments WHERE newsID = ? ORDER BY commentID
Yeah I'm getting that now, but how would I haver the newsID automatically entered - without the user having to do it? Sessions or something like that - which is relatively new to me. I'm down to learn though :-)
#14
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 01:54 PM
SELECT newsID, newsTitle, newsDate from News
which you then use to display links. When a user clicks on a link the newsID is passed to PHP, which uses it in the previously shown query to retrieve comments.
This post has been edited by CTphpnwb: 15 October 2011 - 01:55 PM
#15
Re: Adding On To My Comment/News System
Posted 15 October 2011 - 02:22 PM
|
|

New Topic/Question
Reply



MultiQuote





|