title: Codeigniter - passing value to uri segment
body: <p>My problem is i have this URL/product_id/transaction_num i want to get what is the exact value of the transaction_num in the url. 
  this is the sample output <a href="http://prntscr.com/c124w2" rel="nofollow">http://prntscr.com/c124w2</a> the value of transaction_num must be the same value in invoice # in that example.</p>
  
  <p><strong>CONTROLLER:</strong></p>
  
  <pre><code> $prod_id = $this-&gt;uri-&gt;segment(3);
   $transaction_num = $this-&gt;uri-&gt;segment(4);
   $data['order_detail'] = $this-&gt;MainModel-&gt;view_proditem($prod_id,$transaction_num);
  </code></pre>
  
  <p><strong>MODEL</strong></p>
  
  <pre><code>public function view_proditem($prod_id,$transaction_num) {
  
    $this-&gt;db-&gt;where('product_id', $prod_id);
    $query = $this-&gt;db-&gt;get('order_detail'); 
  
    return $query-&gt;result();
  }
  </code></pre>