Welcome Guest, Not a member yet? Register   Sign In
Basic MY_Model question. Need some help
#6

[eluser]victorche[/eluser]
@jmadsen, thanks for your help.

Anyway I have a complete, finished project. And all those tutorials are just for... learning. I am not a database designer guru, but let's say we have a rent'a car business. I have a controller orders.php, where a new order is added. The model is orders_model.php and the table is `orders`. But I also need to get the list of all available cars (with type, model, engine). And those cars are in another table, called `cars`. So my models are complex and when I have orders_model.php, I don't use only one table is this model (creating a new order needs a dropdown with all the cars, right?).

So, you want to tell me that in my orders_model.php I have to deal only with the orders table? Well, this is not my case. Making a blog tutorial is good, but not enough here.

When we are speaking of tutorials, we always have "posts" case, with "posts" table and "post_id". I am using data from several tables in one model, so I can not just make
Code:
protected $primary_key = 'order_id';
Sometimes the primery key is `order_id`, sometimes is `vehicle_id` etc.


Messages In This Thread
Basic MY_Model question. Need some help - by El Forum - 06-02-2012, 02:19 PM
Basic MY_Model question. Need some help - by El Forum - 06-02-2012, 03:06 PM
Basic MY_Model question. Need some help - by El Forum - 06-02-2012, 03:11 PM
Basic MY_Model question. Need some help - by El Forum - 06-02-2012, 03:14 PM
Basic MY_Model question. Need some help - by El Forum - 06-02-2012, 03:18 PM
Basic MY_Model question. Need some help - by El Forum - 06-02-2012, 03:35 PM
Basic MY_Model question. Need some help - by El Forum - 06-02-2012, 04:36 PM
Basic MY_Model question. Need some help - by El Forum - 06-03-2012, 05:23 AM
Basic MY_Model question. Need some help - by El Forum - 06-03-2012, 06:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB