jwcsk8r Posted March 17, 2007 Share Posted March 17, 2007 Hey everyone, I am going to try and explain what I am trying to do as clearly as possible but even I think I am a little confused. I have one table in a database that is essentially stuff from a commenting script. Things that are posted in it are name, timestamp, id, etc... After this I have another table in the same database that is like a comment system for the first database with id, name, time. How can I set it up so that comments from the second database are only shown if it matches the id from the first database that the person commented on. Quote Link to comment https://forums.phpfreaks.com/topic/43085-connecting-tables-problem/ Share on other sites More sharing options...
jwcsk8r Posted March 17, 2007 Author Share Posted March 17, 2007 apologies...going to move this to sql part of the forum Quote Link to comment https://forums.phpfreaks.com/topic/43085-connecting-tables-problem/#findComment-209289 Share on other sites More sharing options...
The Bat Posted March 17, 2007 Share Posted March 17, 2007 In the first table you mentioned, you could put a field titled 'comment_id', which maches the id in the second table, then use a WHERE clause in your SQL when showing your comments (ie: "WHERE comment_id=X"). Quote Link to comment https://forums.phpfreaks.com/topic/43085-connecting-tables-problem/#findComment-209293 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.