Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Passing values from one function to another in a model?
#3

[eluser]Unknown[/eluser]
[quote author="pickupman" date="1271754581"]
A second part of your question/dilemma could also be fixed using a JOIN statement. You can join the two table based on a matching CatID.
Code:
$this->db->select("PageDetails.*, CatsList.*");
  $this->db->from("PageDetails");
  $this->db->join("CatsList","PageDetails.CatID=CatsList.CatID");
  $query = $this->db->get();
[/quote]

The join statement is what I needed (sorry been a while since I did them in SQL). My next question would be how to get the results to show up under their respective category heading.

UPDATE

Looks like I was able to do it with a little tweaking of the output. Not 100% if this is the recommended way but it does work (from what I can see)

It was done in the view file:

Code:
$catTitle ="";
foreach ($invaders as $inva){
      if ($catTitle == "$inva->CatName") {
      }else{
    echo($inva->CatName);
    $catTitle="$inva->CatName";
      }
    echo ('<li>' . $inva->PageName . '</li>');                
      }

Thank you pickupman for the assistance!!! VERY much appreciated. Now I can move forward with the project and use this ability elsewhere.


Messages In This Thread
[SOLVED] Passing values from one function to another in a model? - by El Forum - 04-20-2010, 10:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB