Simple Inventory System Using PHP/MySQL

Submitted by: 
Visitors have accessed this post 391827 times.

I developed this code to those beginner programmer who found difficulties in creating their inventory system using php/mysql. The feature of this system are, it generates daily inventory report, secure login because i use md5 encryption for login and registration . It also generate reports such as daily, weekly, monthly, and yearly. This system has many features not just the features written above. To try this system just download and run this system. If you have question, suggestion or anything, just leave comment and it's my pleasure to entertain your comments.

database name: liveedit

username: admin
password: admin

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.


Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\inventory\login.php:3) in C:\xampp\htdocs\inventory\login.php on line 5

how can i solved the problem

thank u

Remove the empty lines and spaces at the beginning of login.php. The opening block of the php function should be the first think in the page. I had two blank lines when I installed. The error went away after deleting the two empty lines.


why is not computing the sales ? help me

Good Day, I have downloaded this file but it seems every time I log in it says Opps some thing went wrong.

It also has a notice:

Notice: Undefined index: id in C:\xampp\htdocs\inventory\index.php on line 49

What does it mean? How do I get the program running? Please help, I want to learn more about making an inventory system using php/mysql :3

I'm a junior IT student and I'm also working on my own inventory system. I need to research more design and layouts. Thanks! :)

Error: Opps some thing went wrong


--Original Code--
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "liveedit";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");

--My changes--

$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "inventory"; //chaange this name of datbase name
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");

I hope it will help to you guys.


hey, thanks for the code, it is precise and concise to what i needed, am still a novice at php.mysql, but it seems there are some errors, these i get when i try running it, when i go to the sales tabs i get this

Notice: Undefined index: from in /Applications/MAMP/htdocs/inventory/inventory/tableedit.php on line 288

Notice: Undefined index: to in /Applications/MAMP/htdocs/inventory/inventory/tableedit.php on line 289

when i try prinitng the it seems to havent defined the variable $rtrt in table edit.php, help me to fix this
ma email adress is [email protected]

This is very close to what I was looking for - close enough that I can pull snippets from here and there. It took all of 5 minutes to realize that I needed to add the following to the liveedit.sql:

USE `liveedit`;

and change the user and password in db.php.

something wrong with your database when i import it on mysql

If you will check and read the sql there is nothing wrong with it. if import is not working for you, just manually encode the sql code and the run it.

Dear Argie,
Am doing the same project for my final year. Could i kindly have your documentation spefically the literature review so i could cite you as my source. Please.

I am new in php.I downlode it and when i run this project above
error display & also Notice:undefined indexd : id in c:\wamp\www\inventory\index.php on line 49
please reply

Its working well, Thanks. But how do you sell a product ??

hello po... bakit po ba nka error ang log in...

try mo iload ang sql file sa db... pra mgkaruon nang content ang db mo

ayaw maglog in

tq argie for share some script :)
but, I found bug, can u update this script, I just can't how to fix this :(

thx will see it n back to u soon

Hi Argie,

Need help on the sales menu. Error are listed below:
Notice: Undefined index: from in C:\xampp\htdocs\inventory\tableedit.php on line 283

Notice: Undefined index: to in C:\xampp\htdocs\inventory\tableedit.php on line 284

The codes are: $a=$_POST['from']; $b=$_POST['to'];

Any thoughts about this?

Thanks a lot!


hi argie when i put integer in the quantity sold field in the inventory i need to refresh the system to see the computation in the sales field. . what i am looking is that when i put integer it must be automatically compute and no need to refresh sir argie! but still your program is great very helpful gb

If you need help putting the inventory system to work, you can contact me and for a small fee $20) I can help you get it up and running: [email protected]

hello why is it that there is always error to the qty sold in the inventory??? "Notice: Undefined variable: rtrt in C:\wamp\www\inventory\tableedit.php on line 207" that is exactly the error and i did not change everything :) thank you

i tried removing that error and still run. . just remove the following error listed there

it's all working fine. nice!

what did you do to work?

change updateproduct.php file to:

//mysql_query("UPDATE inventory SET qtyleft='$itemnumber'
//WHERE id='$proid'");

$result = mysql_query("SELECT * FROM inventory
WHERE id='$proid'") or die(mysql_error());

$row = mysql_fetch_array( $result );

$count = $row['qtyleft'] + $itemnumber;

$result = mysql_query("UPDATE inventory SET qtyleft='$count' WHERE id='$proid'")
or die(mysql_error());

header("location: tableedit.php#page=addproitem");

Bro ! i love you thanks to this code

thanks argie!

to all those who are complaining - password, some features not working, blahblah.. why don't you all try to put an effort in reading the code and do a little bug fixing. yes, there are some minor bugs but otherwise argie's work is fine. sheesh!

for one thing, the login, of course, will not work if you haven't damn loaded the SQL file.

where is db file

bakit po yung sa add product nag iinstant update po? d po nag aadd..? tnx..

sira yung codes mo

Hi Argie,

Great code but I do have a question though. On the add item, instead of adding the stock, the app just updates the value of qtyleft. For example the product "qweqwqw" has 10 on qtyleft and if I go to add item and put 15 on quantity, I would like qweqwqw to become 25 instead of 15. How do I go about this? Thanks.

Hoping for your reply.

Can you send me the code for this? we have the same problem.

you look grreat huh teach me how to make a basic program in easyway???

Hi Argie .. I am Angelie can I ask for your help ?? I downloaded your codes , but the sales one .. is not working :( I hope u can help me .. thank u :D

Hi Argie,

I have sent you a PM. I hope you can help me.


Please don't waste time to read & upload it's file. It contains error in login. System isn't work properly.

error in log in

baka may mali sa database mo or yung login_process mo.

Hi. Am I using the correct username and password? I use "admin" for both but I get an error message that username and password not found. I tried entering "3", "admin", "admin" on the register form based on the value on the database but it says "You dont have access to add user pls. contact the administrator".

how do u make sales? i think something is missing


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.