Welcome Guest, Not a member yet? Register   Sign In
problem with anchor tag
#1

[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>
            &lt;?php  foreach($records as $rows) : ?&gt;
            <tr>&lt;?=anchor('product/pro/'.$rows->id,$rows->title) rel=number1;?&gt;
                <td>&lt;?php echo $rows->name; ?&gt;</td>
                <td>&lt;?php echo $rows->price; ?&gt;</td>
            </tr>
            &lt;?php endforeach; ?&gt;
        </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;  
    }


Messages In This Thread
problem with anchor tag - by El Forum - 09-23-2010, 05:07 PM
problem with anchor tag - by El Forum - 09-23-2010, 05:24 PM
problem with anchor tag - by El Forum - 09-23-2010, 05:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB