Auto generate multiple rows from one query php mysql -
i new here , have coders block, please assist, trying multiple results 1 query , create new rows of values it.e.g want row 1 generate row 2 , 3 row 1 general transaction, row 2 interest made row 1 1% , commission made in row 3 @ 0.5%, possible generate query output following results?
date | end date | shop | trans | amount | ref no -----------|-------------|--------|----------|----------|--------- 16/9/2016 | 16/10/2016 | fgb | payed | 10 000 | 251 15/10/2016 | xxxxxxxxx | xxx | xxxx | 100 | 251 15/10/2016 | xxxxxxxxx | xxx | xxxx | 50 | 251
these results should in 1 table possible? in advance.
in mysql cannot make new row out that. but can create columns.
in case can run example like
select *, amount * 0.01 interest, amount * 0.005 commission your_mega_table;
and if modify code can 3 versions of row different amounts.
otherwise need kind of cron script or trigger or stored procedure in database, solve case.
Comments
Post a Comment