Save 1 Time But There Are Double Records In Db

Dear all;

I have a problem about how the controller work. It seem that controller is run twice. I save payment model one time but i get 2 records in db. pls help me.

thanks

my code




public function actionIndex()

{

    $payment = new Payment;

    $payment->product_id = 5;

    echo $payment->save();  

}



Is the page performing the request over ajax?

dear Keith

  I don't have a page for the controller. i just test for inserting data to db and echo the result.

thanks