Array matching to build table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have 3 dynamic arrays which is related data pulled from a mySQL database,
the first being day $days[],second being amount $amount[] and third being a
specific code $code[]. What I need to do is display a table with 1 to 15 in
the left hand column (days) but where the array $days[] contains an item I
need to add a column with the related data but add the values of amount if
there are two entries for a given day, something like the below.

$days[] = ('2', '2', '5');
$amount[] = ('150', '100', '90');
$code[] = ('LAC', 'LAC', 'NCA');

+++++++++++++++++++++
Day | Amount | Code |
1   | 0      |      |
2   | 250    | LAC  |
3   | 90     | NCA  |
4   | 0      |      |

etc. until 15!

Any help would be greatly appreciated my code is getting jumbled and
confusing :(.

Thanks

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux