湖南网站制作外包,长春企业平台,中华室内设计网官网,wordpress的主题哪个好我有以下具有以下值的2表#xff1a;tbl_brandID名称1个苹果2三星tbl_productsID brand_id p_name1个1移动2个1 Earpods3 2移动在这里,当我使用左联接查询即选择’b’.’id’作为’brand_id’,’b’.’name’作为’brand_name’,’p’.’p_name’作为’product_name’FROM’tb…我有以下具有以下值的2表tbl_brandID名称1个苹果2三星tbl_productsID brand_id p_name1个1移动2个1 Earpods3 2移动在这里,当我使用左联接查询即选择’b’.’id’作为’brand_id’,’b’.’name’作为’brand_name’,’p’.’p_name’作为’product_name’FROM’tbl_brand”b’左联接’tbl_products”p ‘ON’p’.’brand_id’’b’.’id’并打印结果,得到以下数组Array([0] stdClass Object([brand_id] 1[brand_name] Apple[product_name] Mobile)[1] stdClass Object([brand_id] 1[brand_name] Apple[product_name] Earpods)[2] stdClass Object([brand_id] 2[brand_name] Samsung[product_name] Mobile)一切正常.但是我正在寻找的结果是这样的Array([0] stdClass Object([brand_id] 1[brand_name] Apple[product_name] stdClass Object([0] Mobile[1] Earpods))[1] stdClass Object([brand_id] 2[brand_name] Samsung[product_name] Mobile)我想根据brand_id键对数据进行分组.我怎样才能做到这一点