Hi all,
i was wondering why cake gives me a weird output array for my query
Query:
SELECT
jobName,
ujc.id,
roleName,
userName,
disciplineName
FROM user_job_connections as ujc
LEFT JOIN jobs on jobs.id = ujc.job_id
LEFT JOIN roles on roles.id = ujc.role_id
LEFT JOIN users on users.id = ujc.user_id
LEFT JOIN disciplines on disciplines.id = ujc.discipline_id
WHERE userName="'.$userName.'"'
Output:
Array
(
[0] => Array
(
[jobs] => Array
(
[jobName] => hub
)
[ujc] => Array
(
[id] => 1
)
[roles] => Array
(
[roleName] => Producer
)
[users] => Array
(
[userName] => philip-f
)
[disciplines] => Array
(
[disciplineName] => Lighting
)
)
I rather would like the output to be:
Array
(
[0] => Array
(
[jobName] => hub
[id] => 1
[roleName] => Producer
[userName] => philip-f
[disciplineName] => Lighting
)
Can somebody tell me why cake creates subarrays for each joint. Makes
displaying the data in the view quite difficult.
Do i have to write my own query function which does not format the
results in such a way? Or run a formatting function after i get the
results.
Any help appreciated.
Thanks
Phil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---