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.


Messages In This Thread
how to take the url to became a variable - by El Forum - 03-31-2009, 08:17 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 08:20 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 08:48 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 09:30 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 09:35 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 09:56 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 10:00 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 10:04 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 10:05 PM
how to take the url to became a variable - by El Forum - 03-31-2009, 10:09 PM
how to take the url to became a variable - by El Forum - 04-01-2009, 01:23 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 06:11 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 06:28 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 06:36 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 06:45 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 06:55 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 07:09 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 07:14 AM
how to take the url to became a variable - by El Forum - 04-01-2009, 06:33 PM
how to take the url to became a variable - by El Forum - 04-01-2009, 06:40 PM
how to take the url to became a variable - by El Forum - 04-01-2009, 07:36 PM
how to take the url to became a variable - by El Forum - 04-01-2009, 08:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB