Welcome Guest, Not a member yet? Register   Sign In
New to PHP, need a little guidance
#9

[eluser]Aken[/eluser]
I'd suggest getting more familiar with the basics of PHP if this has been confusing you. It seems you aren't too keen on how arrays and foreach() work quite yet.

Code:
$follow_ids = array();
$total = 0;

foreach ($query->result_array() as $row)
{
$follow_ids[] = $row['follow_id'];
$total += $row['total'];
}

$variables = array(
array(
  'follow_ids' => implode('|', $follow_ids),
  'total'   => $total
)
);


Messages In This Thread
New to PHP, need a little guidance - by El Forum - 10-12-2012, 02:33 AM
New to PHP, need a little guidance - by El Forum - 10-12-2012, 02:56 AM
New to PHP, need a little guidance - by El Forum - 10-12-2012, 04:07 AM
New to PHP, need a little guidance - by El Forum - 10-12-2012, 04:17 AM
New to PHP, need a little guidance - by El Forum - 10-12-2012, 03:48 PM
New to PHP, need a little guidance - by El Forum - 10-13-2012, 12:18 AM
New to PHP, need a little guidance - by El Forum - 10-13-2012, 03:18 AM
New to PHP, need a little guidance - by El Forum - 10-15-2012, 12:10 AM
New to PHP, need a little guidance - by El Forum - 10-16-2012, 01:06 AM
New to PHP, need a little guidance - by El Forum - 10-16-2012, 05:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB