PHP MySQL Order list
93
Can anyone help?
My code is like this:
<ol><li>{$student_Value}</li> <ol>'
it gives result:
1. Student101Name
1. Student102Name
1. Student103Name
I want something like:
- Student101Name
- Student102Name
- Student103Name
Please help... Thank you!
Answer
Solution:
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.
Good luck.
Answer
Solution:
If you use
MySQL
to get the data you can addORDER BY
to 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:
Answer
Solution:
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:
Answer
Solution:
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.