sim0ng Posted September 11, 2006 Share Posted September 11, 2006 I'm in the process of recoding my cms and want to make catagories for content to be put under and would like a bit of help on how to create a linkup table.I have got this so far for the main content[code] mysql_query($strsql); $strsql = "CREATE TABLE sim0ngportal_manuals_pages (id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,title VARCHAR(255), description MEDIUMTEXT , startpage CHAR(1), PRIMARY KEY (id));";[/code]I will create a new table called "sim0ngportal_manuals_catagories" with just a field to insert catagory names, will probably be called "catagory_name" to keep things nice and simple.Now, how do I then link the 2 together? do i need to create a forin key yo go to the other table? and how do I join it? Have heard that I can use something like "INNER JOIN" but I'm not sure if thats correct or how exactly to use it.Any help would be greatcheers :) Quote Link to comment https://forums.phpfreaks.com/topic/20332-linkup-table/ Share on other sites More sharing options...
HuggieBear Posted September 11, 2006 Share Posted September 11, 2006 You need a column in your content table called category_id or similar, and this will link to the category_id column in your new category table.RegardsRich Quote Link to comment https://forums.phpfreaks.com/topic/20332-linkup-table/#findComment-89568 Share on other sites More sharing options...
sim0ng Posted September 11, 2006 Author Share Posted September 11, 2006 right, okay, should I put it in like this??[code],category_id int(11)[/code] Quote Link to comment https://forums.phpfreaks.com/topic/20332-linkup-table/#findComment-89569 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.