What I want?
I want to display all the comments that are submitted on a particular post. Like if i have post number 2 and it has four comments so I want to retrieve all these 4 comments with the post.
Problem having?
The problem is that,whenever I try to retrieve the comments related the particular post, I get only one comment one post. But not all comments onto that post.
Query I have written :
SELECT zcomment.icomment, zpost.zpostbody, zcomment.myid, zcomment.myname, zpost.zpostid from zcomment LEFT JOIN zpost on zpost.zpostid=zcomment.myid
The above query only print the single comment and single post.
I have used Auto_Increment in zpostid so that whenever any post is submitted the value of it should be inserted into the table.
I have used primary key in zpostid and have made it foreign key in the zcomment table.(with the name myid).
Can anyone help me out with this,i am having this issue for a long time.