PHP MySQL Order list
Can anyone help?
My code is like this:
it gives result:
1. Student101Name 1. Student102Name 1. Student103Name
I want something like:
Please help... Thank you!
Do not close the OL tag every time
OL = Ordered List
LI = List item
If you close and reopen the OL, it creates a new ordered list, and so restarting at 1.
If you use
MySQLto get the data you can add
ORDER BYto the query to order the result!
Here more info how to use ORDER BY
And change the HTML Code to be:
PHP Code will be:
It looks like your problem is more CSS related than PHP or SQL.
The reason is probably that your output is:
Each student should be a list item within the ordered list:
You need something like that
I am giving you above example to tell you that under a 'ol' tag 'li' must be multiple to get your require result.