{"id":458,"date":"2015-02-06T10:59:40","date_gmt":"2015-02-06T10:59:40","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=458"},"modified":"2018-02-22T09:56:40","modified_gmt":"2018-02-22T09:56:40","slug":"load-more-data-using-jquery-ajax-php-from-database","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/","title":{"rendered":"Load More Data from Database using jQuery Ajax PHP MySQL"},"content":{"rendered":"<p>Youtube, Twitter, and Facebook uses Load More Data technique to list dynamic data in a user-friend way. They allow users to dynamically load the data on a button click instead of displaying the pagination links. Show more technique is very interactive because the data is loaded without refreshing the page. In this tutorial, we will show you how to build a similar technique for load more data on click from the database using jQuery, Ajax, and PHP.<\/p>\n<p>The example code builds a simple Load More Data functionality using jQuery and Ajax. For the demonstration purpose, we will retrieve the posts data from the MySQL database and list in the web page. Instead of <a href=\"https:\/\/www.codexworld.com\/php-pagination-class-with-mysql\/\">adding the pagination link to the list<\/a>, we will integrate Show More technique to load posts data dynamically using jQuery, Ajax, PHP, and MySQL.<\/p>\n<p>Our Ajax based load more results with jQuery tutorial make the whole process simple. Let&#8217;s start the <b>load more data from database<\/b> tutorial.<\/p>\n<h2>Create Database Table<\/h2>\n<p>To store the post information a table needs to be created in the database. The following SQL creates an <code>posts<\/code> table with some basic fields in the MySQL database.<\/p>\n<pre><span style=\"color:#794938\">CREATE<\/span> <span style=\"color:#794938\">TABLE<\/span> `<span style=\"color:#bf4f24\">posts<\/span>` (\r\n <span style=\"color:#0b6125\">`id`<\/span> <span style=\"color:#a71d5d;font-style:italic\">int<\/span>(<span style=\"color:#811f24;font-weight:700\">11<\/span>) <span style=\"color:#794938\">NOT NULL<\/span> AUTO_INCREMENT,\r\n <span style=\"color:#0b6125\">`title`<\/span> <span style=\"color:#a71d5d;font-style:italic\">varchar<\/span>(<span style=\"color:#811f24;font-weight:700\">255<\/span>) COLLATE utf8_unicode_ci <span style=\"color:#794938\">NOT NULL<\/span>,\r\n <span style=\"color:#0b6125\">`created`<\/span> datetime <span style=\"color:#794938\">NOT NULL<\/span>,\r\n <span style=\"color:#0b6125\">`modified`<\/span> datetime <span style=\"color:#794938\">NOT NULL<\/span>,\r\n <span style=\"color:#0b6125\">`status`<\/span> enum(<span style=\"color:#0b6125\">'1'<\/span>,<span style=\"color:#0b6125\">'0'<\/span>) COLLATE utf8_unicode_ci <span style=\"color:#794938\">NOT NULL<\/span> DEFAULT <span style=\"color:#0b6125\">'1'<\/span> COMMENT <span style=\"color:#0b6125\">'1=Active, 0=Inactive'<\/span>,\r\n <span style=\"color:#a71d5d;font-style:italic\">PRIMARY KEY<\/span> (<span style=\"color:#0b6125\">`id`<\/span>)\r\n) ENGINE<span style=\"color:#794938\">=<\/span>InnoDB DEFAULT CHARSET<span style=\"color:#794938\">=<\/span>utf8 COLLATE<span style=\"color:#794938\">=<\/span>utf8_unicode_ci;\r\n<\/pre>\n<h2>Database Configuration (dbConfig.php)<\/h2>\n<p>The dbConfig.php file is used to connect and select the MySQL database. Specify the database hostname (<code>$dbHost<\/code>), username (<code>$dbUsername<\/code>), password (<code>$dbPassword<\/code>), and name (<code>$dbName<\/code>) as per your MySQL credentials.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php<br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Database&nbsp;configuration<br \/><\/span><span style=\"color: #0000BB\">$dbHost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"localhost\"<\/span><span style=\"color: #007700\">;<br \/><\/span><span style=\"color: #0000BB\">$dbUsername&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"root\"<\/span><span style=\"color: #007700\">;<br \/><\/span><span style=\"color: #0000BB\">$dbPassword&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"root\"<\/span><span style=\"color: #007700\">;<br \/><\/span><span style=\"color: #0000BB\">$dbName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"codexworld\"<\/span><span style=\"color: #007700\">;<br \/><br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Create&nbsp;database&nbsp;connection<br \/><\/span><span style=\"color: #0000BB\">$db&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">mysqli<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$dbHost<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbUsername<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbPassword<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbName<\/span><span style=\"color: #007700\">);<br \/><br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Check&nbsp;connection<br \/><\/span><span style=\"color: #007700\">if&nbsp;(<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">)&nbsp;{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;die(<\/span><span style=\"color: #DD0000\">\"Connection&nbsp;failed:&nbsp;\"&nbsp;<\/span><span style=\"color: #007700\">.&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">);<br \/>}<br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<h2>Data List with Show More (index.php)<\/h2>\n<p>In this page, the posts data will be retrieved from the MySQL database and listed with the Load More button in the web page.<\/p>\n<p><b>HTML &#038; PHP Code:<\/b><br \/>\nAt first include the database configuration file (<code>dbConfig.php<\/code>). Now, fetch some limited data from the posts table and list them with Show More button.<\/p>\n<pre>&lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"postList\"<\/span>>\r\n&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;database&nbsp;configuration&nbsp;file<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">include&nbsp;<\/span><span style=\"color: #DD0000\">'dbConfig.php'<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;records&nbsp;from&nbsp;the&nbsp;database<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$query&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;*&nbsp;FROM&nbsp;posts&nbsp;ORDER&nbsp;BY&nbsp;id&nbsp;DESC&nbsp;LIMIT&nbsp;2\"<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$postID&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'id'<\/span><span style=\"color: #007700\">];<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    &lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"list_item\"<\/span>><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'title'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>&lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    &lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"show_more_main\"<\/span> <span style=\"color:#bf4f24\">id<\/span><span style=\"color:#794938\">=<\/span><span style=\"color:#0b6125\">\"show_more_main<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span>>\r\n        &lt;<span style=\"color:#bf4f24\">span<\/span> <span style=\"color:#bf4f24\">id<\/span><span style=\"color:#794938\">=<\/span><span style=\"color:#0b6125\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"show_more\"<\/span> <span style=\"color:#bf4f24\">title<\/span>=<span style=\"color:#0b6125\">\"Load more posts\"<\/span>>Show more&lt;\/<span style=\"color:#bf4f24\">span<\/span>>\r\n        &lt;<span style=\"color:#bf4f24\">span<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"loding\"<\/span> <span style=\"color:#bf4f24\">style<\/span>=<span style=\"color:#0b6125\">\"display: none;\"<\/span>>&lt;<span style=\"color:#bf4f24\">span<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"loding_txt\"<\/span>>Loading...&lt;\/<span style=\"color:#bf4f24\">span<\/span>>&lt;\/<span style=\"color:#bf4f24\">span<\/span>>\r\n    &lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n&lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n<\/pre>\n<p><b>JavaScript Code:<\/b><br \/>\nThe jQuery is used to load more data from the database without page refresh, include the jQuery library first.<\/p>\n<pre>&lt;<span style=\"color:#bf4f24\">script<\/span> <span style=\"color:#bf4f24\">src<\/span>=<span style=\"color:#0b6125\">\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.3.1\/jquery.min.js\"<\/span>>&lt;\/<span style=\"color:#bf4f24\">script<\/span>>\r\n<\/pre>\n<p>The following jQuery uses Ajax (<code>$.ajax<\/code>) to get more data from <code>ajax_more.php<\/code> file and listed them under the <code>postList<\/code> div.<\/p>\n<pre>&lt;<span style=\"color:#bf4f24\">script<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"text\/javascript\"<\/span>>\r\n<span style=\"color:#691c97\">$<\/span>(<span style=\"color:#691c97\">document<\/span>)<span style=\"color:#693a17\">.ready<\/span>(<span style=\"color:#a71d5d;font-style:italic\">function<\/span>(){\r\n    <span style=\"color:#691c97\">$<\/span>(<span style=\"color:#691c97\">document<\/span>).on(<span style=\"color:#0b6125\">'click'<\/span>,<span style=\"color:#0b6125\">'.show_more'<\/span>,<span style=\"color:#a71d5d;font-style:italic\">function<\/span>(){\r\n        <span style=\"color:#a71d5d;font-style:italic\">var<\/span> ID <span style=\"color:#794938\">=<\/span> <span style=\"color:#691c97\">$<\/span>(<span style=\"color:#234a97\">this<\/span>)<span style=\"color:#693a17\">.attr<\/span>(<span style=\"color:#0b6125\">'id'<\/span>);\r\n        <span style=\"color:#691c97\">$<\/span>('<span style=\"color:#bf4f24\">.show_more<\/span>')<span style=\"color:#693a17\">.hide<\/span>();\r\n        <span style=\"color:#691c97\">$<\/span>('<span style=\"color:#bf4f24\">.loding<\/span>')<span style=\"color:#693a17\">.show<\/span>();\r\n        <span style=\"color:#794938\">$<\/span><span style=\"color:#693a17\">.ajax<\/span>({\r\n            type:<span style=\"color:#0b6125\">'POST'<\/span>,\r\n            url:<span style=\"color:#0b6125\">'ajax_more-without-design.php'<\/span>,\r\n            data:<span style=\"color:#0b6125\">'id='<\/span><span style=\"color:#794938\">+<\/span>ID,\r\n            <span style=\"color:#bf4f24\">success<\/span>:<span style=\"color:#a71d5d;font-style:italic\">function<\/span>(html){\r\n                <span style=\"color:#691c97\">$<\/span>('<span style=\"color:#bf4f24\">#show_more_main<\/span>'<span style=\"color:#794938\">+<\/span>ID).<span style=\"color:#693a17\">remove<\/span>();\r\n                <span style=\"color:#691c97\">$<\/span>('<span style=\"color:#bf4f24\">.postList<\/span>')<span style=\"color:#693a17\">.append<\/span>(html);\r\n            }\r\n        });\r\n    });\r\n});\r\n&lt;\/<span style=\"color:#bf4f24\">script<\/span>>\r\n<\/pre>\n<h2>Load More Data (ajax_more.php)<\/h2>\n<p>The <code>ajax_more.php<\/code> file is called by the Ajax request and it handles load more data functionality.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Include the database configuration file to connect and select the MySQL database.<\/li>\n<li>Count the total number of records those ID greater than last displayed data ID.<\/li>\n<li>Fetch records from posts table those ID greater than last displayed post ID.<\/li>\n<li>List the post data with Show More button.<\/li>\n<li>Render posts HTML and the view is returned to the success method of Ajax request.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php<br \/><\/span><span style=\"color: #007700\">if(!empty(<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"id\"<\/span><span style=\"color: #007700\">])){<br \/><br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;database&nbsp;configuration&nbsp;file<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">include&nbsp;<\/span><span style=\"color: #DD0000\">'dbConfig.php'<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Count&nbsp;all&nbsp;records&nbsp;except&nbsp;already&nbsp;displayed<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$query&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;COUNT(*)&nbsp;as&nbsp;num_rows&nbsp;FROM&nbsp;posts&nbsp;WHERE&nbsp;id&nbsp;&lt;&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'id'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&nbsp;ORDER&nbsp;BY&nbsp;id&nbsp;DESC\"<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">();<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$totalRowCount&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'num_rows'<\/span><span style=\"color: #007700\">];<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$showLimit&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">2<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;records&nbsp;from&nbsp;the&nbsp;database<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$query&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;*&nbsp;FROM&nbsp;posts&nbsp;WHERE&nbsp;id&nbsp;&lt;&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'id'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&nbsp;ORDER&nbsp;BY&nbsp;id&nbsp;DESC&nbsp;LIMIT&nbsp;<\/span><span style=\"color: #0000BB\">$showLimit<\/span><span style=\"color: #DD0000\">\"<\/span><span style=\"color: #007700\">);<br \/><br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$query<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$postID&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'id'<\/span><span style=\"color: #007700\">];<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<br \/><\/span>    &nbsp;&nbsp;&nbsp;&nbsp;&lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"list_item\"<\/span>><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'title'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>&lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$totalRowCount&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$showLimit<\/span><span style=\"color: #007700\">){&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n        &lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"show_more_main\"<\/span> <span style=\"color:#bf4f24\">id<\/span><span style=\"color:#794938\">=<\/span><span style=\"color:#0b6125\">\"show_more_main<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span>>\r\n            &lt;<span style=\"color:#bf4f24\">span<\/span> <span style=\"color:#bf4f24\">id<\/span><span style=\"color:#794938\">=<\/span><span style=\"color:#0b6125\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$postID<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"show_more\"<\/span> <span style=\"color:#bf4f24\">title<\/span>=<span style=\"color:#0b6125\">\"Load more posts\"<\/span>>Show more&lt;\/<span style=\"color:#bf4f24\">span<\/span>>\r\n            &lt;<span style=\"color:#bf4f24\">span<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"loding\"<\/span> <span style=\"color:#bf4f24\">style<\/span>=<span style=\"color:#0b6125\">\"display: none;\"<\/span>>&lt;<span style=\"color:#bf4f24\">span<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"loding_txt\"<\/span>>Loading...&lt;\/<span style=\"color:#bf4f24\">span<\/span>>&lt;\/<span style=\"color:#bf4f24\">span<\/span>>\r\n        &lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<br \/>&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">}<br \/>}<br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<h2>CSS Code<\/h2>\n<p>The following CSS code is used to specify the style of the posts list and show more link.<\/p>\n<pre><span style=\"color:#bf4f24\">.list_item<\/span> {\r\n    <span style=\"color:#691c97\">background-color<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">#F1F1F1<\/span>;\r\n    -webkit-<span style=\"color:#691c97\">box-shadow<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span> <span style=\"color:#811f24;font-weight:700\">1<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">1<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span> <span style=\"color:#693a17\">rgba<\/span>(<span style=\"color:#811f24;font-weight:700\">0,0,0,.1<\/span>);\r\n    <span style=\"color:#691c97\">box-shadow<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span> <span style=\"color:#811f24;font-weight:700\">1<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">1<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span> <span style=\"color:#693a17\">rgba<\/span>(<span style=\"color:#811f24;font-weight:700\">0,0,0,.1<\/span>);\r\n    <span style=\"color:#691c97\">margin<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">5<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">15<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">2<span style=\"color:#794938\">px<\/span><\/span>;\r\n    <span style=\"color:#691c97\">padding<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">2<span style=\"color:#794938\">px<\/span><\/span>;\r\n    <span style=\"color:#691c97\">font-size<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">14<span style=\"color:#794938\">px<\/span><\/span>;\r\n    <span style=\"color:#691c97\">line-height<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">1.5<\/span>;\r\n}\r\n<span style=\"color:#bf4f24\">.show_more_main<\/span> {\r\n    <span style=\"color:#691c97\">margin<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">15<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">25<span style=\"color:#794938\">px<\/span><\/span>;\r\n}\r\n<span style=\"color:#bf4f24\">.show_more<\/span> {\r\n    <span style=\"color:#691c97\">background-color<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">#f8f8f8<\/span>;\r\n    <span style=\"color:#691c97\">background-image<\/span><span style=\"color:#794938\">:<\/span> -webkit-linear-gradient(<span style=\"color:#b4371f\">top<\/span>,<span style=\"color:#811f24;font-weight:700\">#fcfcfc<\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span>,<span style=\"color:#811f24;font-weight:700\">#f8f8f8<\/span> <span style=\"color:#811f24;font-weight:700\">100<span style=\"color:#794938\">%<\/span><\/span>);\r\n    <span style=\"color:#691c97\">background-image<\/span><span style=\"color:#794938\">:<\/span> linear-gradient(<span style=\"color:#b4371f\">top<\/span>,<span style=\"color:#811f24;font-weight:700\">#fcfcfc<\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span>,<span style=\"color:#811f24;font-weight:700\">#f8f8f8<\/span> <span style=\"color:#811f24;font-weight:700\">100<span style=\"color:#794938\">%<\/span><\/span>);\r\n    <span style=\"color:#691c97\">border<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">1<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#b4371f\">solid<\/span>;\r\n    <span style=\"color:#691c97\">border-color<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">#d3d3d3<\/span>;\r\n    <span style=\"color:#691c97\">color<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">#333<\/span>;\r\n    <span style=\"color:#691c97\">font-size<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">12<span style=\"color:#794938\">px<\/span><\/span>;\r\n    <span style=\"color:#691c97\">outline<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span>;\r\n}\r\n<span style=\"color:#bf4f24\">.show_more<\/span> {\r\n    <span style=\"color:#691c97\">cursor<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">pointer<\/span>;\r\n    <span style=\"color:#691c97\">display<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">block<\/span>;\r\n    <span style=\"color:#691c97\">padding<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">10<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span>;\r\n    <span style=\"color:#691c97\">text-align<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">center<\/span>;\r\n    <span style=\"color:#691c97\">font-weight<\/span><span style=\"color:#794938\">:<\/span><span style=\"color:#b4371f\">bold<\/span>;\r\n}\r\n<span style=\"color:#bf4f24\">.loding<\/span> {\r\n    <span style=\"color:#691c97\">background-color<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">#e9e9e9<\/span>;\r\n    <span style=\"color:#691c97\">border<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">1<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#b4371f\">solid<\/span>;\r\n    <span style=\"color:#691c97\">border-color<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">#c6c6c6<\/span>;\r\n    <span style=\"color:#691c97\">color<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">#333<\/span>;\r\n    <span style=\"color:#691c97\">font-size<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">12<span style=\"color:#794938\">px<\/span><\/span>;\r\n    <span style=\"color:#691c97\">display<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">block<\/span>;\r\n    <span style=\"color:#691c97\">text-align<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">center<\/span>;\r\n    <span style=\"color:#691c97\">padding<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">10<span style=\"color:#794938\">px<\/span><\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span>;\r\n    <span style=\"color:#691c97\">outline<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span>;\r\n    <span style=\"color:#691c97\">font-weight<\/span><span style=\"color:#794938\">:<\/span><span style=\"color:#b4371f\">bold<\/span>;\r\n}\r\n<span style=\"color:#bf4f24\">.loding_txt<\/span> {\r\n    <span style=\"color:#691c97\">background-image<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#693a17\">url<\/span>(<span style=\"color:#234a97\">loading.gif<\/span>);\r\n    <span style=\"color:#691c97\">background-position<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">left<\/span>;\r\n    <span style=\"color:#691c97\">background-repeat<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">no-repeat<\/span>;\r\n    <span style=\"color:#691c97\">border<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">0<\/span>;\r\n    <span style=\"color:#691c97\">display<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#b4371f\">inline-block<\/span>;\r\n    <span style=\"color:#691c97\">height<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">16<span style=\"color:#794938\">px<\/span><\/span>;\r\n    <span style=\"color:#691c97\">padding-left<\/span><span style=\"color:#794938\">:<\/span> <span style=\"color:#811f24;font-weight:700\">20<span style=\"color:#794938\">px<\/span><\/span>;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Youtube, Twitter, and Facebook uses Load More Data technique to list dynamic data in a user-friend way. They allow users to dynamically load the data on a button click instead of displaying the pagination links. <\/p>\n","protected":false},"author":1,"featured_media":3076,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[28,16,122,19,14],"class_list":["post-458","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-ajax","tag-jquery","tag-loadmore","tag-mysql","tag-php","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Load More Data from Database using jQuery Ajax PHP MySQL - CodexWorld<\/title>\n<meta name=\"description\" content=\"Youtube style show more data on click from the database using jQuery Ajax and PHP. Load more results from database with jQuery and Ajax. Load more pagination to retrieve dynamic data from database without page refresh using jQuery, Ajax, PHP, and MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Load More Data from Database using jQuery Ajax PHP MySQL - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Youtube style show more data on click from the database using jQuery Ajax and PHP. Load more results from database with jQuery and Ajax. Load more pagination to retrieve dynamic data from database without page refresh using jQuery, Ajax, PHP, and MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-06T10:59:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-02-22T09:56:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/02\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Load More Data from Database using jQuery Ajax PHP MySQL\",\"datePublished\":\"2015-02-06T10:59:40+00:00\",\"dateModified\":\"2018-02-22T09:56:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/\"},\"wordCount\":430,\"commentCount\":22,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png\",\"keywords\":[\"Ajax\",\"jQuery\",\"LoadMore\",\"MySQL\",\"PHP\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/\",\"name\":\"Load More Data from Database using jQuery Ajax PHP MySQL - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png\",\"datePublished\":\"2015-02-06T10:59:40+00:00\",\"dateModified\":\"2018-02-22T09:56:40+00:00\",\"description\":\"Youtube style show more data on click from the database using jQuery Ajax and PHP. Load more results from database with jQuery and Ajax. Load more pagination to retrieve dynamic data from database without page refresh using jQuery, Ajax, PHP, and MySQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"load-more-data-pagination-jquery-ajax-php-mysql-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/load-more-data-using-jquery-ajax-php-from-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Load More Data from Database using jQuery Ajax PHP MySQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Load More Data from Database using jQuery Ajax PHP MySQL - CodexWorld","description":"Youtube style show more data on click from the database using jQuery Ajax and PHP. Load more results from database with jQuery and Ajax. Load more pagination to retrieve dynamic data from database without page refresh using jQuery, Ajax, PHP, and MySQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/","og_locale":"en_US","og_type":"article","og_title":"Load More Data from Database using jQuery Ajax PHP MySQL - CodexWorld","og_description":"Youtube style show more data on click from the database using jQuery Ajax and PHP. Load more results from database with jQuery and Ajax. Load more pagination to retrieve dynamic data from database without page refresh using jQuery, Ajax, PHP, and MySQL.","og_url":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2015-02-06T10:59:40+00:00","article_modified_time":"2018-02-22T09:56:40+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/02\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Load More Data from Database using jQuery Ajax PHP MySQL","datePublished":"2015-02-06T10:59:40+00:00","dateModified":"2018-02-22T09:56:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/"},"wordCount":430,"commentCount":22,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/02\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png","keywords":["Ajax","jQuery","LoadMore","MySQL","PHP"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/","url":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/","name":"Load More Data from Database using jQuery Ajax PHP MySQL - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/02\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png","datePublished":"2015-02-06T10:59:40+00:00","dateModified":"2018-02-22T09:56:40+00:00","description":"Youtube style show more data on click from the database using jQuery Ajax and PHP. Load more results from database with jQuery and Ajax. Load more pagination to retrieve dynamic data from database without page refresh using jQuery, Ajax, PHP, and MySQL.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/02\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/02\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png","width":1366,"height":768,"caption":"load-more-data-pagination-jquery-ajax-php-mysql-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/load-more-data-using-jquery-ajax-php-from-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Load More Data from Database using jQuery Ajax PHP MySQL"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/02\/load-more-data-pagination-jquery-ajax-php-mysql-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-7o","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=458"}],"version-history":[{"count":37,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/458\/revisions"}],"predecessor-version":[{"id":3099,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/458\/revisions\/3099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/3076"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}