Simple Inventory Sytem using PDO (For Beginners!)

Submitted by: 
Visitors have accessed this post 12568 times.

1. OPEN phpmyadmin and create your desired database name.
2. While you are in your desired database, upload the sql file included in the project.
3. Change the database name in db.php to your desired database name.
4. run using your web server (Ex. wamp or xampp) and enjoy!

In this inventory system you can:

  1. Add/Edit/Delete Items
  2. View number of items sold
  3. Search for existing items
  4. Add Quantity to existing items
  5. Sell Items
  6. View Sales Reports

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.


1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.


bro thaanks for this program

For those with problems, if works perfect right out of the box. The exact details for installing are covered perfectly by Mr. Soriano above. You do need a basic understanding of how databases work. Do not try to run this on older browsers, you will not like what you see. It is formatted for newer browsers. It is very basic code, but absolutely not for beginners!! This is a good teaching tool if you want to understand PDO.

if you can i would like you to customize this with more futures please let me know futures like connecting to my online store and get orders and deduct from inventory

Hello there, sure. What features do you want? Add me on facebook

You Can't Spell IGNorant Without IGN.

no search text field in sourcecodester


Thanks for the code. However, I'm getting this message on the homepage:

Notice: Undefined variable: hostname in C:\xampp\htdocs\inventory\db.php on line 6
ERROR: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
Notice: Undefined variable: conn in C:\xampp\htdocs\inventory\index.php on line 78

Fatal error: Call to a member function prepare() on a non-object in C:\xampp\htdocs\inventory\index.php on line 78

Thanks for your help.

Your mysql password is the problem

You Can't Spell IGNorant Without IGN.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe> [video]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.