jeudi 27 décembre 2018

Need mysql data with grouped values based on column values in php

I have table schema as below

name   type  total
name1  type1  10
name1  type1  10
name1  type2  20
name1  type3  30
name2  type1  30
name2  type2  40
name2  type3  50
name2  type4  25

i need output as

name  type1 type2 type3 type4
name1 20    20     30    0
name2 30    40     50    25

How can i achieve this using php and mysql. Can anyone please help me out to solve this



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire