Inserting different data to different table

Hello guys,

I am new to yii and does not have much experience. I would like to ask for help about the thing I need to do. There is a table for example named test now I need to get the value from it and send it’s value to different table in a new model,controller and view for exampled named process. I really don’t know how to start doing it since I don’t fully understand the yii yet. Thanks a lot if you know a link please just share it to me thanks a lot God Bless.

Another one is how could I get the sum value from a table,


$this->total_amount = $this->salesDetails->quantity_sold;

I used this code but it returns 0 values since it gets many rows how do I access that? thanks and if ever I used this code


$this->order=$this->dbConnection->createCommand('SELECT Sum(s.quantity) FROM ..tablename here...where')->queryScalar();

 

How could I add $this->salesDetails->quantity_sold after the where statment? thanks

Kevin

Kevin

[color="#006400"]/* moved to proper forum */[/color]

Guys, can someone help me?? Thanks =)I really need help, our deadline is near and no improvement at all … Thanks

Kevin, we really need to see code to be able to help or at least an attempt at an approach. It sounds like you’re having to jump in and be productive (I know the feeling) without having learned the Yii fundamentals you’ll need to understand what’s going on. My suggestion: re-read The Definitive Guide to Yii especially the “Fundamentals” section and “Working with Databases”. Take the time to try out some code. If you have a good feel for that, move on to The Yii Blog Tutorial to see a functioning application. This should give you the skills to get started.

Good luck.

Hello bglee,

Thanks for replying to this post, I am really lost to what should I do now, I will look at the links and read it. Actually I need to finish it this week for our project in school.

But can I ask you something? though you told me to read and try codes I am afraid that I don’t have enough time but I would still try solving it.

But maybe you know so I would ask you, how can I create a module that can access different tables without relationship? I just want to inform you on my current problem now there is a table that receives data from a csv, that table is just and temporary storage. Now I have to access that table and send it’s information or data to different tables. Thanks a lot for your help bglee, God Bless!

Kevin =)