Sunday, 15 September 2013

PHP to get the cloumn names which are not null

PHP to get the cloumn names which are not null

Hi I am trying to write a php code . where I want get the cloumn names
which are not null.
My db looks like
person username p1 p2 p3 p4
raj raju_01 30 40
raj ravi_02 70 80
raj king_03 90 70
king raju_01 60 90
king ravi_02 80 80
king king_03 90 70
So when I query for non empty coloums for person-raj-- I need to get only
coloumn name p1,p2 when I querey for person king I need to get p3,p4. But
at same time I need to check raj should repeated for 3 times and king must
be repeated for 5 times.
Can anyone suggestme how to this.

No comments:

Post a Comment