I am working on a news based website.The thing is I want my site to be like other news sites.in which the news have thumbnails and if there is no room for them,the older news would go to the next page!I just want to have a general idea about this.Is there some kind of programming behind this kind of work(that every time you want to add a news,the program automatically sorts it and give it a thumbnail)and or should the admin of the page(me in this case for example) rewrite the html file of the news?I hope I made my self clear enough about what I want to do!
Yes, when you query the database you're going to want to LIMIT
your query to a certain number results, and also set a start and an end to the query. See a tutorial here
Example:
$sql = "SELECT * FROM students ORDER BY name ASC LIMIT 0, 20";
When the next
button is clicked, for example, your next query might look like this:
$sql = "SELECT * FROM students ORDER BY name ASC LIMIT 20, 20"; -- Start from 20, and take 20
You would use some server side language to keep track of where the query started and left off.
It's called pagination, I suggest you do some reading on the subject. No one is going to give you all the code, you seem to not know what you are doing.