For the first question, using ScrollTop() you can load iterations of data from your PHP after an interval of pixels has been scrolled.
You will need a PHP file, and JavaScript.
This is written freehand with no testing so I can't guarantee these will work, but try something along these lines:
JavaScript
jQuery(document).ready(function($){
// Set the number of pixels from the top you want the event to fire
// Select the number of books you would like to load each time
// i = number of loads you've called
var reloadAfter = 500;
var numberBooks = 20;
var i = 1;
$(window).scroll(function() {
if ( $(this).scrollTop() >= reloadAfter )
{
$.get("getbooks.php", {number:numberBooks , counter:i} )
.done(function(data){
$('#books').append("Title:", data.title)
.append("Author:", data.author);
});
reloadAfter = reloadAfter + reloadAfter;
i++;
}
});
PHP
$numberBooks = $_GET['number'];
$i = $_GET['counter'];
$upper = ( $numberBooks * $i );
$lower = ( $upper - $numberBooks );
$get_books = mysql_query('SELECT * FROM BOOkTABLE WHERE id > $lower AND id < $upper');
echo json_encode($get_books);