Lambneck Posted August 21, 2009 Share Posted August 21, 2009 What I'm working on is a tag system for a blog. When someone clicks on a tag link they should be taken to a page listing all entries related to that tag. However the tag data is in one table and the blog entries data is in another table. So the 'tag' value is passed in the URL it is specifying which row in the "tags table" should be referenced. Within this row (in the tags table) is a column called blog_entry_id which contains the id number of the corresponding bog entry data in the other table. My question is how to write the select query in order to accomplish this? $sql="SELECT * FROM blog_table WHERE tag_table=$_GET['id'] AND blog_entry_id=actual_blog_id"; //? Quote Link to comment https://forums.phpfreaks.com/topic/171271-tag-system-a-tale-of-two-tables/ 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.