Welcome Guest, Not a member yet? Register   Sign In
Query with a sub array of data (mysql join)
#1

[eluser]Media Gearhead[/eluser]
I am having troubles getting a mysql join to set the joined data as an array on an index. What I would like to do is query my user database and get an array of all the posts they have.

What I am getting now.
Code:
Array[0]
- username = joe
- post_number = 1
Array[1]
- username = joe
- post_number = 3
Array[2]
- username = joe
- post_number = 3
Array[3]
- username = jane
- post_number = 4

What I would like.
Code:
Array[0]
- username = joe
- post_number = Array(
- - 1
- - 2
- - 3
)
Array[1]
- username = jane
- post_number = Array(
- - 4
)

I would like to do this with 1 query and I would imagine its possible. Any assistance would be appreciated.




Theme © iAndrew 2016 - Forum software by © MyBB