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); ?>
<?php
$n=$_GET['nid'];
//echo CHtml::encode($data->newsletter->getAttributeLabel('nid'));
//echo $n;
?>
<?php $result = Yii::app()->db->createCommand()
->select('year,month')
->from('tbl_newsletter')
->where('nid = ' . $n)
->queryRow();
// print_r($result);
echo implode(" ",$result);?>
<div class="control-group">
<?php echo $form->labelEx($model,'Category'); ?>
<?php echo $form->dropDownList($model,'cid', CHtml::listData(Category::model()->findAll(), 'cid', 'name'), array('prompt'=>'Choose Category')); ?>
<?php echo $form->error($model,'cid'); ?>
</div>
<div class="control-group">
<?php echo $form->labelEx($model,'SubCategory'); ?>
<?php echo $form->dropDownList($model, 'sid',array('prompt'=>'Choose Subcategory')); ?>
<?php echo $form->error($model,'sid'); ?>
</div>