Practice on: PHP, HTML, BootStrap, AJAX, MySQL
- This page calculate body BMI and recorded in the Database
- When first time loaded, it pulls all the information from Database
- Table is paginated
- Mostly using Bootstrap, very small amount of my own CSS code
- If you do not wish to expose your BMI, please do not use this table
Learning – I used XMLHttpRequest to pull the whole HTML table page from a PHP file. it wasn’t a good idea because JS event needs to be coded in PHP file too. I tried to include the event only in JS file, but it was not working. It seems the event is registered before the table is loaded, and Delete button comes from PHP file too, so in this case, it will not work.
The delete button is not working and it is easy to make it work. I’ll just leave it as it is now, so I have something to fix in the future, and it will be a good review of the code for me. 🙂
Check the fully functional page here – showcase.
- Delete from table
- Filter so it only displays a specific user’s BMI record
- Include current date