Welcome Guest, Not a member yet? Register   Sign In
how to take the url to became a variable
#21

[eluser]jedd[/eluser]
When you post code segments, can you please identify if they are Controller, Model, View ?

I think your current problem is that this section of your controller (?) :
Code:
$query = $this->db->get('testimonial');
if($query->num_rows() > 0){ // it should be '$query' not '$user_row' my mistake
     $data[] = $query->row();
}
$this->adm_testimonial($data);

... is not going to work as you think it might. I'd suggest that rather than shuffle stuff into data at this point (this function is in your controller, right, or am I confused?) you should just:

Code:
$query = $this->db->get('testimonial');
if ($query->num_rows() > 0) {
     $result = $query->row();
}
$this->adm_testimonial($result);

And then in adm_testimonial - the controller not the view of the same name - grab $result from the parameter list.

So instead of what you have now:

Code:
function adm_testimonial($id=0)

.. you'd have
Code:
function adm_testimonial ($result = NULL)

And you'd test for $result not being NULL within that function.

At the moment you're sending $data across from one function, and calling it $id on the way into your other function, and $id already means something else somewhere else .. and, ya know, really, I think rather than trying to get re-directions working you should probably just focus on getting data working using conventional CI URL and pathing first.
#22

[eluser]yudahebat[/eluser]
im still confusing
with your explaination

sorry, I make you confusing....

but I really2 need the code to choose the testimonial that I choose
to pass to the form view
and then the testimonial that I passed to the form view will I Update
that the skenario...

I need this code very much to finish my last project on college...
and I stress think about it

help me please

thx b4




Theme © iAndrew 2016 - Forum software by © MyBB