Simple Library Management System in PHP using MySQL

By | June 20, 2017

This project is the prototype of a Simple Library Management System. Librarian has a provision to add book details like ISBN number, book title, author name, edition and publication details through the web page. In addition to this, librarian or any user has a provision to search for the available books in the library by the book name. If book details are present in the database, the search details are displayed on the web page.

 

This application is partitioned into 5 different files.

  1. To enter book details through an HTML web page – EnterBook.php
  2. To insert book details into the database – InsertBooks.php
  3. HTML web page to enter book name to be searched – SearchBooks.php
  4. PHP web page to display search results – DisplayBooks.php
  5. Database connection details – DBConnection.php

 

 

Enter book details for a Library Management System

 

Suggested Read:

 

Insert book details in Library Management System

Search for a book in Library Management System

 

Searched book details in Library Management System

 

MySQL scripts to create database and table for a Library Management System

Suggested articles for you:

43 thoughts on “Simple Library Management System in PHP using MySQL

  1. swetha

    sir i use tomcat to run php code and mysql server for db.inserted books is not shown in display page.why???

    Reply
    1. Ravi Bandakkanavar Post author

      Hi,

      Please check whether the records are present in the table. If records are present then we need to check whether fetch query is working fine or not.

      Reply
  2. Chaitali

    how should I connect to database using oracle 10g username and password?

    Reply
  3. asad ali

    sir i’m having an issue on insert page
    Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\lib\insertbooks.php on line 17
    this is the error
    please help

    Reply
    1. Ravi Bandakkanavar Post author

      Hi,

      I believe it is getting failed at insert query. Please check your database connection and the book_info table structure.

      Reply
  4. Teju

    how to create db ?
    can i create it using oracle(run sql) software

    Reply
  5. Teju

    can i use xampp and can store my db in phpmyadmin is it possible or not please answer me

    Reply
  6. Saud

    Notice:Undefined varialbe:Search on Displaybook.php
    Please can u help me

    Reply
  7. Jacob

    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\wamp64\www\librarydemo\DisplayBooks.php on line 18. any help?

    Reply
  8. Thankyou

    Ravi, just wanted to say a big thankyou, works fine and is a great tutorial for creating and searching records!
    Thankyou again

    Reply
  9. Zayn

    sir everything is working fine but the data is not being retrieved. I do not have sql in my system, so is it because of that?? Kindly note that no error is being shown!

    Reply
  10. Puja

    Hello sir plzz help me can u send me the complited code of book-shop management…
    I m beginner don’t know how to connect front end to the backend plzz help sir…
    Can u send the code in this mailId-pujakk911@gmail.com

    Reply
  11. rexmainali@gmail.com

    sir please can uhelp me sending complete database project on library mgmt system on sql htmlphp
    i can help u from any after submission i daily surf this krazytechblog
    ao believe on me i need compleete code with this 5 november please try this fo r me

    Reply
  12. sathasivam

    I am beginner. i don’t know how to create table in db and connecting with db……….can u give me a solution for the above library management system……

    Reply
  13. sudha

    sir, i need this code as fast as possible the above code is getting errors

    Reply
  14. saipraveen

    mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in D:\xampp\htdocs\klu\insertbook1.php plzzz fix it bro….

    Reply
    1. Ravi Bandakkanavar Post author

      Hi Sai,

      In the InsertBooks code, there is only one function being used.
      $result = mysqli_query($db,$query); i.e. to insert the book details into the database.

      Reply
  15. Sam b

    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\WEB PROGRAMMING FOR 3rd SEm\BOOK INFO\DisplayBooks.php on line 14

    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\WEB PROGRAMMING FOR 3rd SEm\BOOK INFO\DisplayBooks.php on line 30
    AccessNo Title Author Edition Publication

    Reply
    1. Sam b

      Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in what to do i dont knw brooo plzzzzzzz fix this prblm wht can i do

      Reply
  16. kanika

    Hy, please if you can help me with the code for issuing book and returning books and fine calculation

    Reply
  17. PUJA DAS

    enterbooks.php is a html file.there is no use of php tag(?php ?>)..why did you save it as a php file?

    Reply
    1. Ravi Bandakkanavar Post author

      Hi Puja,

      PHP is a server side scripting language. It executes on the server and only the output is downloaded on the client’s computer whereas the HTML is a client side scripting language and whole code is executed on the client’s computer.

      It is advised to maintain uniformity while building any application.
      We can extend our code anytime to display error messages set from a PHP page on to the form page. You can see this practice followed in the in Java login/registration application.
      https://krazytech.com/programs/java-registration-page-using-servlet-mysql-mvc
      https://krazytech.com/programs/a-login-application-in-java-using-model-view-controllermvc-design-pattern

      Reply
      1. Puja Das

        Thank you.could you please upload the source code of how to issue books,return books,availability of books,display all these thing..

        Reply
      2. PUJA DAS

        Thank you.Could you please upload or write the source code of how to issue books,return books,availability of books,display books..

        Reply

Did it help? Comment here..