Matching arrays to build tables
| From: | Mike Quinn | Date: | Mon, 29 Sep 2003 04:30:38 +0000 |
| Subject: | Matching arrays to build tables | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-21592@lists.php.net to get a copy of this message | ||
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 |Amt. | 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