Hello everyone,
Im new at this site, and I hope I can get some help for my assignment.
I have been asked to do the following:
Build a pyramid using PHP and MySQL and depends on how many rows. For now I have made the following in my mysql:
blocks
- id (unique ID)
- position (a number that grows higher for every new data)
Lets say I put 6 data in the MySQL then I would like the pyramid to look like this:
6
54
321
And if I add a new row:
7
65
4321
And lets make another one:
8
76
543
21
And so on... The data with highest "position" will always be on top. I have looked for answers making a for loop, but I simply can't figure this out :/
Anyone that can help me? Would really appreciate it! Thanks in advance