Posted by Prince of Code on 12/28/05 10:37
Hey Guys
Lets assume we have two arrays
one bug array - main array
another user array - sub array
The bug array contains the id of the user to whom the bug is
assigned to.
This Id is present in the user array for example
bug - IE Error has assignedto id as 2
this id 2 corresponds to user Peter in the user array
how do i create a third array
bugUserArray such that
assigned to id of the bug user array should contain the complete
detail of particular user
as follows
-----------------------------------------------------------------
Bug Array
Array
(
[0] => Array
(
[varbugId] => 71
[varbugProjectId] => 23
[varbugAssignedToId] => 2
[varbugTitle] => IE Error
[varbugDescription] => The application ...
)
[1] => Array
(
[varbugId] => 72
[varbugProjectId] => 45
[varbugAssignedToId] => 3
[varbugTitle] => General Protection fault
[varbugDescription] => GPF Fault occurs ...
)
[2] => Array
(
[varbugId] => 73
[varbugProjectId] => 23
[varbugAssignedToId] => 2
[varbugTitle] => Login Problem
[varbugDescription] => User banned by the admin can...
)
)
-------------------------------------------------------
user Array
Array
(
[0] => Array
(
[varUserId] => 1
[varUserLoginName] => smith
[varUserPassword] => password
[varUserFullName] => Mr Smith
[varUserEmail] => smith@gmail.com
[varUserDateCreated] => 2005-12-15 15:17:41
)
[1] => Array
(
[varUserId] => 2
[varUserLoginName] => Peter
[varUserPassword] => Peter
[varUserFullName] => Xavier Peter
[varUserEmail] => peter@gmail.com
)
[2] => Array
(
[varUserId] => 3
[varUserLoginName] => coolguy
[varUserPassword] => password
[varUserFullName] => Administrator
[varUserEmail] => coolguy@gmail.com
)
[3] => Array
(
[varUserId] => 4
[varUserLoginName] => alzemer
[varUserPassword] => alzemerlogin
[varUserFullName] => Alzemer Alex
[varUserEmail] => alzemer@gmail.com
)
)
bug user array
-------------------------------------------------------------------
Bug User Array
Array
(
[0] => Array
(
[varbugId] => 71
[varbugProjectId] => 23
[varbugAssignedToId] => Array
(
[varUserId] => 2
[varUserLoginName] => Peter
[varUserPassword] => Peter
[varUserFullName] => Xavier Peter
[varUserEmail] => peter@gmail.com
)
[varbugTitle] => IE Error
[varbugDescription] => The application ...
)
[1] => Array
(
[varbugId] => 72
[varbugProjectId] => 45
[varbugAssignedToId] => Array
(
[varUserId] => 4
[varUserLoginName] => alzemer
[varUserPassword] => alzemerlogin
[varUserFullName] => Alzemer Alex
[varUserEmail] => alzemer@gmail.com
)
[varbugTitle] => General Protection fault
[varbugDescription] => GPF Fault occurs ...
)
[2] => Array
(
[varbugId] => 73
[varbugProjectId] => 23
[varbugAssignedToId] => Array
(
[varUserId] => 3
[varUserLoginName] => coolguy
[varUserPassword] => password
[varUserFullName] => Administrator
[varUserEmail] => coolguy@gmail.com
)
[varbugTitle] => Login Problem
[varbugDescription] => User banned by the admin can...
)
)
[Back to original message]
|