Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 4 Model - One to Many - how to?
#1

(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.
Reply


Messages In This Thread
CodeIgniter 4 Model - One to Many - how to? - by Scott103 - 09-27-2021, 08:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB