I have a MySQL query like this
SELECT id,seq,text FROM table ORDER BY seq ASC;
ID | SEQ | text
________
1 | 1 | one
2 | 4 | four
3 | 6 | six
But i need to accomplish table like this
ID | SEQ | text
________
1 | 1 | one
| 2 |
| 3 |
2 | 4 | four
| 5 |
3 | 6 | six
I could do it with multiple queries, but that would be gross. I think it’s possible with some loop in PHP. The point is that i need to fill the empty rows just with sequence number. Any ideas?
Retrieve max seq no from Db
then try a loop
Above is the blueprint for your answer. I hope you’ll get the idea.
UPDATE :
Fetch Record from this query
I have explained here what i mean by
for( loop for $seq)