Welcome Guest, Not a member yet? Register   Sign In
Ticketing system (sorta)
#4

[eluser]Bionicjoe[/eluser]
I solved it!!

Put it all into one big array. (The stupid! It hurts!)

Code:
function displayoutage()
  {

      $this->data = array(
          'row' => $this->outage_model->getoutage($id)->result(),
          'update' => $this->outage_model->listoutageupdates($id),
          'title' => 'Simple Outage View',
        'headline' => 'Simple Outage View',
        'include' => 'outagedisplay_view',
        'footer' => 'Copyright 2010'
          );

    $this->load->view('template_view', $this->data);

However I've hit a new snag. I can only get one item out of my array with a foreach loop. I know the array is good because I did a simple 'print_r($array)', and the loop echos out the HTML once for each item in the array. But I only see the last item.

Code:
print_r($update);

    foreach ($update as $i)
        echo '<hr>';
        echo $i


Sample array from print_r
Code:
Array ( [1] => My first update. [2] => The second update. [3] => Another update. )

The above code spits out a horizontal rule for each item in the array, and then only the last item in the array, in this case 'Another update.'.


Messages In This Thread
Ticketing system (sorta) - by El Forum - 06-17-2010, 04:59 AM
Ticketing system (sorta) - by El Forum - 06-17-2010, 09:14 AM
Ticketing system (sorta) - by El Forum - 06-18-2010, 01:51 AM
Ticketing system (sorta) - by El Forum - 06-18-2010, 03:44 AM
Ticketing system (sorta) - by El Forum - 06-18-2010, 04:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB