1. Databases
2. table login
3. login.php
4. main.php
How to Login PHP By OOP (2)
========================================================
1. databases : mydatabase
========================================================
Copy below :
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 16, 2019 at 11:30 AM
-- Server version: 5.1.37
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `mydatabase`
--
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE IF NOT EXISTS `customer` (
`CustomerID` varchar(50) NOT NULL,
`Name` varchar(50) NOT NULL,
`Email` varchar(50) NOT NULL,
`CountryCode` varchar(50) NOT NULL,
`Budget` varchar(50) NOT NULL,
`Used` varchar(50) NOT NULL,
`bath` int(255) NOT NULL,
PRIMARY KEY (`CustomerID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`CustomerID`, `Name`, `Email`, `CountryCode`, `Budget`, `Used`, `bath`) VALUES
('C001', 'ບົວສະຫວັນ', 'win.weerachai@gmail.com', 'THB', '1', '5', 0),
('C0022', 'John Smith2', 'john.smith@gmail.com2', 'UK', '10', '552', 22),
('C003', 'James Borns', 'jame.born@gmail.com', 'USS', '1000', '5000', 0),
('C005', 'HaraRock', 'HaraRock@gmail.com', 'A5', '200', '12345', 12345),
('C004', 'BEH', 'Beh@gmail.com', 'THB', '100', '55', 55),
('C006', 'KK', 'H@gmail.com', 'LAOS', '1234', '1234', 25);
-- --------------------------------------------------------
--
-- Table structure for table `events`
--
CREATE TABLE IF NOT EXISTS `events` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`title` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`start` date NOT NULL,
`end` date NOT NULL,
`color` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`notify` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
--
-- Dumping data for table `events`
--
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE IF NOT EXISTS `login` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`UserName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`Pass` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`Name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
--
-- Dumping data for table `login`
--
INSERT INTO `login` (`ID`, `UserName`, `Pass`, `Name`) VALUES
(1, 'b', 'b', 'Hararock');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`UserID` varchar(4) COLLATE utf8_unicode_ci NOT NULL,
`UserName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`Email` varchar(50) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`UserID`, `UserName`, `Email`) VALUES
('C001', 'Win', 'win.@gmail.com'),
('C002', 'John', 'john@gmail.com');
ไม่มีความคิดเห็น:
แสดงความคิดเห็น