Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

How to create Simple Order Management in PHP MySQL

Author: Priyanshu Raj
by Priyanshu Raj
Posted: Oct 31, 2018
in this article we are going to learn simple How to create simple order management system in PHP MySQL. the help of this script you can able to manage products, manage categories and place an order with order history detail.you Can Download the full source follow the below Link.

Getting Bootstrap

Bootstrap can be Download to your needs from their Getting Started page but I would prefer using the CDN option, because it is faster also it is advised to go through and get yourself accustomed with some bootstrap terms, including common classes. This page also some Examples of how to use Bootstrap classes.

1-Creating Database

  • Open PHPMyAdmin in your Browser
  • Click on Database Tab Display on Topside
  • Give the Database name "order".
  • After Creating Database Open it.
  • Click on SQL Tab on Top area
  • Copy the Below Source Code and paste it.
  • Then Click on Go.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173-- phpMyAdmin SQL Dump-- version 4.8.2-- https://www.phpmyadmin.net/---- Host: 127.0.0.1-- Generation Time: Oct 30, 2018 at 11:44 AM-- Server version: 10.1.34-MariaDB-- PHP Version: 5.6.37 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";SET AUTOCOMMIT = 0;START TRANSACTION;SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;/*!40101 SET NAMES utf8mb4 */; ---- Database: `order`-- -- -------------------------------------------------------- ---- Table structure for table `category`-- CREATE TABLE `category` ( `categoryid` int(11) NOT NULL, `catname` varchar(30) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---- Dumping data for table `category`-- INSERT INTO `category` (`categoryid`, `catname`) VALUES(13, 'Veg '),(14, 'Non-Veg'),(16, 'Sweats'); -- -------------------------------------------------------- ---- Table structure for table `product`-- CREATE TABLE `product` ( `productid` int(11) NOT NULL, `categoryid` int(1) NOT NULL, `productname` varchar(30) NOT NULL, `price` double NOT NULL, `photo` varchar(150) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---- Dumping data for table `product`-- INSERT INTO `product` (`productid`, `categoryid`, `productname`, `price`, `photo`) VALUES(23, 13, 'Paneer', 150, 'upload/creamy-matar-paneer-curry.1024x1024-2-225x225_1540894616.jpg'),(24, 13, 'Fried Rice', 120, 'upload/miso-fried-rice-2-225x225_1540894652.jpg'),(25, 14, 'Chicken', 250, 'upload/Easy-Chinese-Chilli-Chicken-Dry-4-225x225_1540894754.jpg'),(27, 16, 'Rasgulla', 25, 'upload/rasgulla-250x250_1540894743.jpeg'); -- -------------------------------------------------------- ---- Table structure for table `purchase`-- CREATE TABLE `purchase` ( `purchaseid` int(11) NOT NULL, `customer` varchar(50) NOT NULL, `total` double NOT NULL, `date_purchase` datetime NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---- Dumping data for table `purchase`-- INSERT INTO `purchase` (`purchaseid`, `customer`, `total`, `date_purchase`) VALUES(10, 'Raj', 270, '2018-10-30 15:52:43'); -- -------------------------------------------------------- ---- Table structure for table `purchase_detail`-- CREATE TABLE `purchase_detail` ( `pdid` int(11) NOT NULL, `purchaseid` int(11) NOT NULL, `productid` int(11) NOT NULL, `quantity` int(11) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---- Dumping data for table `purchase_detail`-- INSERT INTO `purchase_detail`(`time_insert`,`pdid`, `purchaseid`, `productid`, `quantity`) VALUES(CURRENT_TIMESTAMP,13, 8, 15, 2),(14, 8, 17, 2),(15, 8, 18, 2),(16, 9, 15, 5),(17, 10, 24, 1),(18, 10, 23, 1); ---- Indexes for dumped tables-- ---- Indexes for table `category`--ALTER TABLE `category` ADD PRIMARY KEY (`categoryid`); ---- Indexes for table `product`--ALTER TABLE `product` ADD PRIMARY KEY (`productid`); ---- Indexes for table `purchase`--ALTER TABLE `purchase` ADD PRIMARY KEY (`purchaseid`); ---- Indexes for table `purchase_detail`--ALTER TABLE `purchase_detail` ADD PRIMARY KEY (`pdid`); ---- AUTO_INCREMENT for dumped tables-- ---- AUTO_INCREMENT for table `category`--ALTER TABLE `category` MODIFY `categoryid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; ---- AUTO_INCREMENT for table `product`--ALTER TABLE `product` MODIFY `productid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; ---- AUTO_INCREMENT for table `purchase`--ALTER TABLE `purchase` MODIFY `purchaseid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; ---- AUTO_INCREMENT for table `purchase_detail`--ALTER TABLE `purchase_detail` MODIFY `pdid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;OR Import DB File

After Downloading the source code extract it in your root folder.

  • Open PHPMyAdmin in your Browser
  • Click on Database Tab Display on Top side
  • Give the Database name "ang-crud".
  • After Creating Database Open it.
  • Click on Import Tab on Top area
  • You can Find Db file in Downloaded source code Select it.
  • Then Click on Go.
Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Priyanshu Raj

Priyanshu Raj

Member since: Oct 30, 2018
Published articles: 1

Related Articles