Welcome Guest, Not a member yet? Register   Sign In
NewBie...Hwo to pass query string parameter from list view
#1

[eluser]myjeep_2003[/eluser]
I am trying to pass querystring parameter from listview to detail view... like this ... some wrong in my procedure...

My view look slike this where it creates a link with $id

<p>
&lt;?php foreach($query_show_plan_and_prepare_list as $row):?&gt;

&lt;?php form_hidden('myid',$row->id);?&gt;
<p><h3>&lt;?php echo anchor('mycontent/show_plan_detail/'.$row->id, $row->Title);?&gt;</h3></p>
<p class="info">posted: &lt;?php echo $row->modified;?&gt;</p>
&lt;?php endforeach;?&gt; </p>


On clicking

<p><h3>&lt;?php echo anchor('mypost/show_plan_detail/'.$row->id, $row->Title);?&gt;</h3></p>


I want to pass the parameter(id) to my controller mypost/show_plan_detail function.

Then I want to use the passed parameter(id) to write a query in Model.. what will show content Detail of that id..
#2

[eluser]Ngulo[/eluser]
hi,you should use uri helper , to extract $this->uri segment();

for example

mysite.com/action/9

$this->uri->segment(3) returns 9
#3

[eluser]myjeep_2003[/eluser]
Hey thanks a million... that was sweet....victory..worked....
#4

[eluser]Ngulo[/eluser]
eheheh don't worry this is the basics,i also had to learn them Wink




Theme © iAndrew 2016 - Forum software by © MyBB