php - How to select Unknown Number of Columns in mysql? -


given table , names of columns, have following information schema select query.

select `column_name`                 `information_schema`.`columns`                     `table_schema` = 'm_college'                     , `table_name` = 'm_fee'                     , column_name not in ('id', 'classid', 'semid') 

but select not give me rows value each unknown column select. got names of unknown columns. possible select values of rows can have column key , rows value pair in php script? need insert column names , row values in other table. please or suggest.

below quick attempt @ showing intersect table.

this allows have fixed structure , add fee types on fly.

create table if not exists `mz_fee222` (   `id` int(11) not null auto_increment,   `classid` int(11) not null,   `semid` int(11) not null,   `batch` year(4) not null,   `session` int(11) not null );  create table fee_type (   fee_id int auto_increment primary key,     description varchar(100) ); insert fee_type (description) values ('exam'),('marksheet'),('admitcard'),('centre'),('practical'); -- etc go  create table mz_fee_intersect (   -- here fee amount stored. flexible.     id int auto_increment primary key,     mz_id int not null, -- id my_fee222 table     fee_id int not null, -- fee_id fee_type table     fee int not null, -- here actual fee, 100 bucks     -- fk's below (not shown):      --      unique key (mz_id,fee_id) -- forbids duplicates ); 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -