You have two options:
- Save data (in a file, in mysql…)
- Grab the data every time a user loads the page (check every page for news)
Of course it is better to save the data in some way, but it is possible to do it without a database or similar.
You have to realize that PHP starts from scratch every time the page is loaded, so you need something to store the information so that your PHP file doesn’t have to repeat a lot of work.
1
solved infinite scroll without database [closed]