Welcome Guest, Not a member yet? Register   Sign In
Models inside Models, or...options
#1

[eluser]Unknown[/eluser]
Hey Guys,

I'm trying to keep my database code out of my controllers and in models. Unfortunately, I have to use the Filemaker API for database access, so I can't use the built in database functionality...that would be too easy. Anyway. I have a User model that contains all my user data and db functionality. I want to be able to do something like get_users('Status','Approval Pending'), that would return an array of User Models. I tried creating a 'Users' (note the plural) model for handling groups of users, but I cannot seem to use the single User model from within it. I could do the search from within my controller, but I want to keep it DB clean.

Any ideas?

Greg
#2

[eluser]├╝berfuzz[/eluser]
(My guess is that you're referring to active record.) You can query a data-base with plain MySQL in CodeIgniter.

Make a model for users. users.php in that model you can put different methods; get_user() get_users() etc.




Theme © iAndrew 2016 - Forum software by © MyBB