Alex Rivera | Logout

Where to connect to DB in MVC

Asked 2010-02-10T20:19:58.423
11

I am using php and building an MVC for my web application. I am to the step where I need to connect to my DB, look at the current URL, compare that to data in my DB, and then return the correct content from my DB to the user.

My question is, where should I put the code that connects to the DB and processes it? Would this go in the Model class?

Edit
Report

1 Answer

3

All the database interaction is inside the Model class.

answered 2010-02-10T20:24:31.257

Your Answer