Sencha ExtJS 5 and sencha touch Tutorial , by Hery Purnama , Sencha ExtJS Freelance Trainer - +62.81.223344.506 , http://freelance-it-trainer.blogspot.com

What Is Sencha ExtJS : Sencha Ext JS is the leading standard for business-grade web application development. With over 100 examples, 1000 APIs, hundreds of components, a full documentation suite and built in themes, Ext JS provides the tools necessary to build robust desktop applications.


Tuesday, April 7, 2015

Tutorial 2 - Create MySQL Database for Extjs 5 web application example

I will use PHP and MySql database for all of my main ExtJS tutorial , i will create database named "dbextjs" and three tables in it ( tbproductsales , tbproductcat , tbuser )

Here's the SQL script that you can execute with your phpmyadmin

-- phpMyAdmin SQL Dump
-- version 2.11.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 07, 2015 at 11:00 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.5

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `dbextjs`
--

-- --------------------------------------------------------

--
-- Table structure for table `tbproductcat`
--

DROP TABLE IF EXISTS `tbproductcat`;
CREATE TABLE IF NOT EXISTS `tbproductcat` (
  `catid` int(10) unsigned NOT NULL auto_increment,
  `catname` varchar(50) NOT NULL,
  `catstatus` int(11) NOT NULL default '1',
  PRIMARY KEY  (`catid`),
  KEY `catname` (`catname`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `tbproductcat`
--

INSERT INTO `tbproductcat` (`catid`, `catname`, `catstatus`) VALUES
(1, 'ELEKTRONIK', 1),
(2, 'OTOMOTIF', 1);

-- --------------------------------------------------------

--
-- Table structure for table `tbproductsales`
--

DROP TABLE IF EXISTS `tbproductsales`;
CREATE TABLE IF NOT EXISTS `tbproductsales` (
  `prdid` int(10) unsigned NOT NULL auto_increment,
  `prdname` varchar(50) NOT NULL,
  `prdcat` int(11) NOT NULL,
  `prdprice` double NOT NULL,
  `prdqty` int(11) NOT NULL,
  `salesdate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`prdid`),
  KEY `prdname` (`prdname`,`prdcat`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `tbproductsales`
--

INSERT INTO `tbproductsales` (`prdid`, `prdname`, `prdcat`, `prdprice`, `prdqty`, `salesdate`) VALUES
(1, 'TOYOTA KIJANG', 2, 120000000, 5, '2015-04-07 21:54:21'),
(2, 'NISAN GRAND LIVINA XV', 2, 185000000, 14, '2015-04-07 21:54:21'),
(3, 'HONDA SUPRAFIT', 2, 12000000, 33, '2015-04-01 21:54:52'),
(4, 'MESIN CUCI MIYAKO', 1, 2350000, 65, '2015-04-07 21:55:29'),
(5, 'TV FLAT LG 50 INCH', 1, 12300000, 14, '2015-02-12 21:56:46'),
(6, 'KULKAS SANYO 3 PINTU', 1, 4300000, 21, '2015-03-19 21:56:38');

-- --------------------------------------------------------

--
-- Table structure for table `tbusers`
--

DROP TABLE IF EXISTS `tbusers`;
CREATE TABLE IF NOT EXISTS `tbusers` (
  `userid` int(10) unsigned NOT NULL auto_increment,
  `username` varchar(50) NOT NULL,
  `userpwd` varchar(10) NOT NULL,
  `userlevel` varchar(50) NOT NULL default 'User',
  PRIMARY KEY  (`userid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `tbusers`
--

INSERT INTO `tbusers` (`userid`, `username`, `userpwd`, `userlevel`) VALUES
(1, 'admin', 'admin123', 'Admin'),
(2, 'hery', 'hery123', 'User');

Thanks

Hery Purnama
Freelance IT Trainer
http://freelance-it-trainer.blogspot.com
081.223344.506






No comments:

Post a Comment