![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jun 2007
Posts: 93
Rep Power: 2
![]() |
joining associative arrays
I have 3 arrays, they all hold the same information except for one row, which changes in each of the arrays:
[cal_id] => 7
[cal_create_by] => admin
[cal_date] => 20070704
[cal_time] => 60000
[cal_duration] => 120
[cal_name] => Test Address
[cal_description] => This is whats wrong with the machine
[cal_data] => 5982462
[cal_login] => user1
[cal_lastname] => person
[cal_firstname] => one
--
[cal_id] => 7
[cal_create_by] => admin
[cal_date] => 20070704
[cal_time] => 60000
[cal_duration] => 120
[cal_name] => Test Address
[cal_description] => This is whats wrong with the machine
[cal_data] => $106. Please call 1/2 hour prior to arriving.
[cal_login] => user1
[cal_lastname] => person
[cal_firstname] => one
--
[cal_id] => 7
[cal_create_by] => admin
[cal_date] => 20070704
[cal_time] => 60000
[cal_duration] => 120
[cal_name] => Test Address
[cal_description] => This is whats wrong with the machine
[cal_data] => Map 145 - H1
[cal_login] => user1
[cal_lastname] => person
[cal_firstname] => oneHow can i join these arrays so i have something like [cal_id] => 7
[cal_create_by] => admin
[cal_date] => 20070704
[cal_time] => 60000
[cal_duration] => 120
[cal_name] => Test Address
[cal_description] => This is whats wrong with the machine
[cal_data1] => 5982462
[cal_data2] => $106. Please call 1/2 hour prior to arriving.
[cal_data3] => Map 145 - H1
[cal_login] => user1
[cal_lastname] => person
[cal_firstname] => one |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I would suggest that you are wasting resources. Investigate an array of arrays.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jun 2007
Posts: 93
Rep Power: 2
![]() |
thanks for your advice DaWei,
for anyone interested a 3d array was the way to go. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Confusion With Pointers and Arrays | JawaKing00 | C | 10 | Sep 14th, 2006 7:33 AM |
| Arrays or Vectors? | can342man | C++ | 2 | Apr 20th, 2006 3:57 PM |
| Pairing elements of two arrays...please help!!! | smg1001 | Java | 14 | Jan 17th, 2006 5:01 PM |
| Arrays in PHP | MrMan9879 | PHP | 6 | Jan 12th, 2006 9:18 PM |
| Arrays | Gunman | C++ | 17 | Oct 20th, 2005 6:11 AM |