update form

hi guys,

pllllzzz give me a solution

i have 2 tables newsletter & pages i given link of pages on newsletter’s view & on pages i get nid(pk of newsletter)i display it on pages using select query so while upadting on pages it shows me error-undefined index nid.

plllzz give me solution how can i update that pages.here is my code-

_form.php

<?php echo $form->errorSummary($model); ?>

        &lt;?php 


               &#036;n=&#036;_GET['nid'];


                //echo CHtml::encode(&#036;data-&gt;newsletter-&gt;getAttributeLabel('nid'));





               //echo &#036;n;


            ?&gt;


      &lt;?php &#036;result = Yii::app()-&gt;db-&gt;createCommand()


            -&gt;select('year,month')


            -&gt;from('tbl_newsletter')


            -&gt;where('nid = ' . &#036;n)


            -&gt;queryRow();


           // print_r(&#036;result); 


          echo implode(&quot; &quot;,&#036;result);?&gt;


            








&lt;div class=&quot;control-group&quot;&gt;


	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'Category'); ?&gt;


	&lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'cid', CHtml::listData(Category::model()-&gt;findAll(), 'cid', 'name'), array('prompt'=&gt;'Choose Category')); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'cid'); ?&gt;


&lt;/div&gt;





&lt;div class=&quot;control-group&quot;&gt;


	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'SubCategory'); ?&gt;


	&lt;?php echo &#036;form-&gt;dropDownList(&#036;model, 'sid',array('prompt'=&gt;'Choose Subcategory')); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'sid'); ?&gt;


&lt;/div&gt;

Where do you have the error? What row?

With these few information is difficult to help you.