a table
a_id name
1 1
2 2
3 3
4 4
5 5
b table
b_id name a_id
1 a 1
2 b 1
3 c 1
4 d 2
5 e 2
how to write the sql statement to query 10 pieces of data for each category
find an array structure similar to the following:
array(
array(
"a_id"=>1,
"a_name"=>1
"b_list"=>array{
array(
"b_id"=>1,
"b_name"=>a,
"a_id"=>1,
),
array(
"b_id"=>1,
"b_name"=>a,
"a_id"=>1,
),
}
},
array(
"a_id"=>1,
"a_name"=>1
"b_list"=>array{
array(
"b_id"=>1,
"b_name"=>a,
"a_id"=>1,
),
array(
"b_id"=>1,
"b_name"=>a,
"a_id"=>1,
),
}
},
);
I"m not sure if this structure can be checked by mysql. How efficient is it? I want to toss about (A V A)
.