Welcome Guest, Not a member yet? Register   Sign In
You probably get this one..?
#5

[eluser]developer10[/eluser]
[quote author="John_Betong" date="1285659669"]Play about with this:
Code:
// in you Model
if ($query->num_rows() > 0)
{
  $projekti = $query->result_array();
      
  foreach ($projekti as $row)
  {
    $broj = $this->db->count_all_results('job_ponude', array('pro_id' => $row['pro_id']));

    // Debug: remove rem on next line to see the count_all_result()
    // echo '<br />' .$broj;

    $data['broj'][] = $broj;
  }
            

// in you View
  foreach($broj as $detail => $row):
    echo '<br />details: ', $detail;
    echo '<br />row:     ', $row;
  endforeach;
[/quote]

I tried your code but still not getting the counted value.

Variable $data should carry to view both $projekti variable and counted variable. So, how to merge these values into $data:

Code:
$data = $projekti // from main query (main rows)
$data = /* counted value from foreach loop inside the model */
$data['broj'][] = $broj; // this was your example but it seems not to work :(

Thanks for trying though. Hope something else crosses your ming, or way to work this out?


Messages In This Thread
You probably get this one..? - by El Forum - 09-27-2010, 12:51 PM
You probably get this one..? - by El Forum - 09-27-2010, 01:07 PM
You probably get this one..? - by El Forum - 09-27-2010, 01:58 PM
You probably get this one..? - by El Forum - 09-27-2010, 08:41 PM
You probably get this one..? - by El Forum - 09-28-2010, 08:29 AM
You probably get this one..? - by El Forum - 09-28-2010, 08:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB