CodeIgniter Forums
Tables are Posts and Tags. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Tables are Posts and Tags. (/showthread.php?tid=73229)



Tables are Posts and Tags. - michaleben123 - 04-03-2019

Tables are Posts and Tags. 

One Post has Many Tags. And One Tag has Many Posts. A so-called 'Many-to-Many' relationship. 

This is solved with a intermediate table (post_tag) with id for post_id and tag_id and a created_at row. 

Now, How do you handle this in CodeIgniter? 

And before you answer. I also wish to learn how to handle updating records in intermediate table. 

As in, I remove a Post or I add a new Tag to a Post. 

Thanks, [Image: smile.gif]


RE: Tables are Posts and Tags. - php_rocs - 04-03-2019

@michaleben123,

Can you setup an sqlfiddle ( http://sqlfiddle.com/ ) so that we can see all of the tables structure. This will help us help you.