How to Create pagination using php and mysql

welcome back to shortlearner.com, in our previous post we learn how to create a signup or registration page with the help of AJAX, PHP and MySQL.

Now in this post today we will learn how to create a pagination using PHP and MySQL.

so most of the time we see when we are developing any kind of software and when we fetch records from our MySQL database it probably returns us thousand or millions records. so it is not a good idea to show all records on a single page, so we split all those records into multiple pages.

pagination in php and mysql

so before start this tutorial we just take an overview how we split records into multiple pages.
first of all we are establish a database connection , in this tutorial my database name is library. so i am going to fetch all the books name and their title which are stored in the table name called bookstore.

Also Read :
PHP Login Script With Remember me.
Unable to create a directory a wordpress error
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

Get YouTube video thumbnail using PHP

welcome back to shortlearner.com , in our previous post we learn how to convert YouTube URL to embed URL PHP.in this post we will see how to Get YouTube video thumbnail and use it with PHP
so in the below code we explode the URL and create a link which will show the thumbnail of individual video id and use it on img tag.

How to get YouTube Video Thumbnail

Also Read :
How to Install PHP on CentOS.
How to integrate Razorpay Payment Gateway using PHP.

Get Domain name from URL
Unable to create a directory a wordpress error
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

how to delete a file with the help of PHP

Welcome back to shortlearner.com, in this post we will see how to delete a file inside the directorywith the help of PHP.

delete a file using php

so its quite easy to delete the files inside the directory with the help of a single predefined PHP function. PHP provide us a predefined function unlink.
with the help of this function we can easily delete the files from our directoryso in the below example we should try to learn how the unlink function works.

Also Read :
Get Domain name from URL
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?


so here i am creating a variable $file_pointer , in the value of this variable we put the file name which we want to delete from our directory,

so in the below example i want to delete myfile.php from my directory so i put this inside the value of variable.

and put this variable as a parameter into unlink function
. whenever i run this file, the unlink function works and delete the myfile.php file from my directory.

Enable PHP Zip Extension through cPanel

Welcome back to shortlearner.com, in this post we will see how to enable PHP ZIP extension on cPanel.
before start this tutorial, we should take a overview about PHP extension.
so basically PHP extension enables you to transparently read or write ZIP compressed archives and the files inside them.

how to enable extensions in cpanel


and most of the time it is disable by default in cPanel , so we have to manually install it.
So just follow the steps and install these extensions manually.
Note: try to follow snaps for better understanding.

step 1: So in the very first step , we should login into our cPanel(Control Panel) and than go to the software section
Step 2: in the software section click on PHP Pear Packages

Enable PHP ZIP Extensions in cPanel

Also Read :
Get Domain name from URL
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

Step3: after clicking on PHP Pear Packages we are searching our ZIP extension and install it.

enable php extension

step 4 : After installing the package we should again go to our software section and click on the PHP version .

install zip archive

Step5: once we click on the select PHP Version, we can see all the enable extension over there, and we can see our Archiv_ZIP as well. so we just checked it and hit on the save button to add archive_zip in our current PHP version.

enable php zip extension

Step5: now the last and very important step we will follow to complete this tutorial.again go to the software section and click on the PHP processes and hit the kill process button.

zip enable in cpanel

Now we can use your PHP ZIP Extension our website.

Launch Bootstrap Modal on page load

Welcome back to shortlearner.com, today we will see how to Launch Bootstrap Modal on page load using JavaScript. so in the very first step we will create a index.html file than we will write our JavaScript code which are helps to show our Bootstrap modal on loading of index.html file.

on page load show modal

In the index.html file we will call the bootstrap.min.js and bootstrap.min.css to load bootstrap files in our web page.

index.html

Add the below bootstrap maxcdn files in the head section of index.html

Also Read :
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

now we write down our JavaScript code to launch bootstrap modal on the loading of index.html web page. so put the below JavaScript code on the body section of the index file.

on the above JavaScript code we called the modal id and change its behavior from fade to show.

just go to the browser and run your index.html file, the bootstrap modal will automatically launch on page load.

Also Read

Check Email is already registered in database with the help PHP, AJAX And JQuery