[eluser]don-wp[/eluser]
hi there
i'm newbie with CI and already have problem that I couldnt find any solution in the forum or user guide
I want to have a dynamic link that get the id of selected row from database because I want to open that row in a new pop up window using jquery but I face with same error with every changes I made in codes.I would be appreciated if any one could solve it.here is my code
the controller
Code:
<?php
class Product extends Controller {
function pro() {
$this->load->model('Product_model');
$data['records'] = $this->product_model->pro($id);
$this->load->view('pro_view',$data);
}
}
The product_view file
Code:
<table align="center" style="vertical-align: middle; top: 120px;">
<thead>
<th>name</th>
<th>price</th>
</thead>
<tbody>
<?php foreach($records as $rows) : ?>
<tr><?=anchor('product/pro/'.$rows->id,$rows->title) rel=number1;?>
<td><?php echo $rows->name; ?></td>
<td><?php echo $rows->price; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
The product_model
Code:
function Pro($id){
$query = $this->db->get_where('product', array('id'=>$id));
$ret['rows'] = $query->get()->result();
return $ret;
}