I am having trouble finding a solution for this question. Suggest any solution for this question in PHP.
I have a table called test_repeat
id start repeater length final
1 20 2 3 50
2 10 50 4 500
and my query is
SELECT T.id AS ID, T.start AS start, T.repeater AS repeater
T.length AS length, T.final AS final
FROM `test_repeater` T
RIGHT JOIN `test_repeater` T2 ON T.id = T2.id
WHERE T.start>=10 and T2.start*T2.repeater<=300
the result i’m getting is
ID start repeater length final
1 20 2 3 50
2 10 5 12 500
What I am trying to get is the result in such a way that the each start value is added with the repeater and that makes that value as next raw until the final the conditions apply (please see below)
My dream result will be like this
ID start repeater length final
1 20 2 3 50
1 22 2 3 50
1 24 2 3 50
1 ... . . ...
1 ... . . ...
1 50 2 3 50
2 10 5 4 500
2 15 5 4 500
2 20 5 4 500
2 25 5 4 500
2 30 5 4 500
2 35 5 4 500
2 ... . . ...
2 ... . . ...
2 ... . . ...
2 500 5 4 500
OK. That makes more sense…