I'm trying to make a script for PHP that loads 5 lines of images where 3 images on all lines are loaded and showed, however on the last one only 2 images are loaded and a image with "load more" appears. When You push it it loads the rest of images using jQuery.
I'm using MYSQLi to get the data however I do not know hot wo put it the way I described. I appriciate any, seriously any help in that case!
Your question is more of theory, so I will give you theory steps.
hope this theory will give you a start.
You can load the first three with an initial Database query; however if you can use JS and JQuery then you can always use an AJAX call to get the other 2 images on the event.
Essentially you get the first 3 images and display them, then you have a button below that says 'load more'. When that button is clicked, call a Javascript function that uses some AJAX to call a PHP script that will load the other images.
The (probably easier) other method is to get all the images at once, show your button that says 'load more' and hide the other 2 images. On click of that button show the other two images. something like
<div id="fristThree">
<img ... />
<img ... />
<img ... />
</div>
<div id="otherTwo">
<img ... />
<img ... />
<button> load more </button>
and in Jquery, just hide the 'otherTwo' div, then on button click, show it via jquery.
But I still would think AJAX is the preferred method.