i have two tables. one it_device (sbitid, sbequip,sbbrand, sbmodel, sbserial, sbpurchsdt, sbcurrentuser, sbhandovrdt) and eqiplogs (id, currentuser, date). whenever i insert\update data into it_device it should insert one row in eqiplogs with id, currentuser and date information. i tried to follow wiki but it didn’t work out. it updates data into it_device and not in equiplogs.
my code is mentioned below:
<public function actionCreate()
// Uncomment the following line if AJAX validation is needed
because you are checking the $_POST array twice separately 1st for the presence of Euiplogs and next for ItDevice if you POSTED Euiplogs and ItDevice the first if statement gets executed, saves Euiplogs to the table and then you instruct the YII to redirect the to the last inserted record’s view page so the next condition will be skipped so that’s is a problem so can remove the redirect line from the first condition or rewrite the entire method