What is the best way to paginate results in SQL Server

Finally, Microsoft SQL Server 2012 was released, I really like its simplicity for a pagination, you don’t have to use complex queries like answered here. For getting the next 10 rows just run this query: SELECT * FROM TableName ORDER BY id OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY; https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql#using-offset-and-fetch-to-limit-the-rows-returned Key points to consider … Read more

Check if a user has scrolled to the bottom (not just the window, but any element) [duplicate]

Use the .scroll() event on window, like this: $(window).scroll(function() { if($(window).scrollTop() + $(window).height() == $(document).height()) { alert(“bottom!”); } }); You can test it here, this takes the top scroll of the window, so how much it’s scrolled down, adds the height of the visible window and checks if that equals the height of the overall … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)