adambedford Posted February 13, 2010 Share Posted February 13, 2010 So I've got a table (Links) with a field called 'Category_ID' that stores a number. This value is matched to the field 'ID' in the table 'Categories'. The Categories table also has a field called 'Category_name'. I have a recordset/query that returns data from the table 'Links' based on a URL filter of 'Category_ID'. How would use this Category_ID to return the value of 'Category_name' from the other table? Link to comment https://forums.phpfreaks.com/topic/191967-getting-information-from-table2-using-field-in-table1/ Share on other sites More sharing options...
MatthewJ Posted February 13, 2010 Share Posted February 13, 2010 SELECT links.*, categories.name FROM links JOIN categories ON links.Category_ID = categories.Category_ID Link to comment https://forums.phpfreaks.com/topic/191967-getting-information-from-table2-using-field-in-table1/#findComment-1011807 Share on other sites More sharing options...
adambedford Posted February 13, 2010 Author Share Posted February 13, 2010 Perfect! Thank you. Link to comment https://forums.phpfreaks.com/topic/191967-getting-information-from-table2-using-field-in-table1/#findComment-1011811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.