CodeIgniter 4 Model - One to Many - how to? |
09-27-2021, 08:04 AM
(This post was last modified: 09-28-2021, 01:43 AM by InsiteFX. Edit Reason: Fixed Bad text output please do not copy and paste )
Hey guys,
I am new to CodeIgniter 4 and self-taught, so for sure I am missing some skill or knowledge :-). Anyway - I am building simple quiz. One page will have multiple questions, and these questions will have multiple answers. I have three database tables for pages, questions and answers. Each of them has own Model. And I'm storing IDs of answers in questions table as json encoded aswers IDs. Same for questions IDs in pages table. Getting data for view is like scratching your left ear with your right hand. I am looping for json decoded arrays and finding items by IDs from other Model It is working well, but I am not sure that "this is the way". I was googling But I'm not sure how to do it the CodeIgniter. Can you kick me in the right direction? Thanks. |
Messages In This Thread |
CodeIgniter 4 Model - One to Many - how to? - by Scott103 - 09-27-2021, 08:04 AM
RE: CodeIgniter 4 Model - One to Many - how to? - by kenjis - 09-28-2021, 12:20 AM
RE: CodeIgniter 4 Model - One to Many - how to? - by InsiteFX - 09-28-2021, 01:47 AM
RE: CodeIgniter 4 Model - One to Many - how to? - by wdeda - 09-28-2021, 02:51 AM
RE: CodeIgniter 4 Model - One to Many - how to? - by paulkd - 09-28-2021, 03:24 AM
|