0
Show comments of specific news article using php.
I need help guys. I want to show the comments of a specific news article. I have a table for comments and one for news. I added a news_id column in the comments table, which corresponds to the id of the article in the news table. How do I go about this? (procedure of doing it in codeigniter would be best but any other is wrlcomed).
10 Réponses
+ 2
i dont know if i understand your question, but i thing your sql code should be something like this:
select n.article from comments as c, news as n where c.news_id = n.id
+ 1
please give me more information. or show me the code you wrote with the result and an example of your tables
+ 1
no i dont
+ 1
if i could help you it would be nice if you post your way to solve the problem, or upvote the post which helps to find out your solution
0
@Oliver, you've understood it well. I tried using that but I still got the same comments for different news articles. What might be wrong?
0
Sorry for delay. do u use codeigniter? ?
0
mmm, its a bit tough then coz its wat I use. let me try to cut out the clutter.
0
hey @Oliver I've solved it. Thanks for ē help anyway
0
@Oliver, it was sth to do with how I was handling the data in codeigniter. I had to set the news id, and pass it into the model and the view.
But thanx for ur answer really, it reminded me of sm things.
0
Muito Bom