Membuat Web CMS Sendiri dengan PHP (1. Menyiapkan Database)
Perlengkapan
- Komputer untuk kerja
- Web Server termasuk PHPnya
- Database Server MySQL
- Text Editor Favorit (notepad,wordpad dll)
- Web Hosting + Domain (optional)
Konfigurasi Database
Membuat Database Dengan MySQL Clientshell> CREATE DATABASES mycms;
atau gunakan phpMyAdmin jika anda menggunakan XAMPP
Masukkan nama database kemudian klik 'Create'
Membuat Table User
CREATE TABLE `cms_user` (
`id` bigint(9) unsigned zerofill NOT NULL auto_increment,
`username` varchar(20) default NULL,
`password` varchar(80) default NULL,
`fullname` varchar(80) default NULL,
`email` varchar(200) default NULL,
`date_register` datetime NOT NULL default '2008-01-01 00:00:00',
`last_login` datetime NOT NULL default '2008-01-01 00:00:00',
`last_ip` varchar(100) default NULL,
`level` int(3) NOT NULL default '1',
`gender` enum('M','F') NOT NULL default 'M',
`date_of_birth` date default '0000-00-00',
`address` text,
`province` varchar(100) default NULL,
`zipcode` varchar(5) default NULL,
`country` varchar(100) default NULL,
`phonehome` varchar(50) default NULL,
`handphone` varchar(50) default NULL,
`phoneoffice` varchar(50) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB;
CREATE TABLE `cms_content_category` (
`id` bigint(6) unsigned NOT NULL auto_increment,
`parent_id` bigint(6) unsigned default '0',
`name` varchar(200) default NULL,
`auth_level_view` int(3) unsigned default '0',
`auth_level_post` int(3) unsigned default '99',
`status_category` int(2) default '1',
`language` varchar(80) NOT NULL default 'bahasa',
`link_module` varchar(80) default NULL,
`position` enum('mtop','mleft','mright','no') NOT NULL default 'mtop',
`default_content` bigint(15) unsigned NOT NULL default '0',
`order` bigint(6) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cms_content` (
`id` bigint(12) unsigned NOT NULL auto_increment,
`name` varchar(80) default NULL,
`category` bigint(6) unsigned default NULL,
`description` longtext,
`date_post` datetime NOT NULL default '2008-01-01 00:00:00',
`date_edit` datetime NOT NULL default '2008-01-01 00:00:00',
`flag_view` int(3) default '1',
`author` bigint(9) unsigned zerofill default NULL,
`language` varchar(80) NOT NULL default 'bahasa',
`flag_default` tinyint(3) default '0',
PRIMARY KEY (`id`),
KEY `category` (`category`),
KEY `author` (`author`),
CONSTRAINT `cms_content_ibfk_1` FOREIGN KEY (`category`) REFERENCES `cms_content_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `cms_content_ibfk_2` FOREIGN KEY (`author`) REFERENCES `cms_user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cms_vote` (
`id` bigint(5) unsigned NOT NULL auto_increment,
`description` varchar(200) default NULL,
`vote_start` datetime default NULL,
`vote_end_interval` int(3) unsigned default '0',
`vote_flag_status` int(3) unsigned default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cms_vote_list` (
`id` bigint(9) unsigned NOT NULL auto_increment,
`id_vote` bigint(5) unsigned default NULL,
`description` varchar(40) default NULL,
`hit` bigint(9) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `id_vote` (`id_vote`),
CONSTRAINT `cms_vote_list_ibfk_1` FOREIGN KEY (`id_vote`) REFERENCES `cms_vote` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
halo.....
BalasHapussalam kenal....
lanjutan kedua, ketiganya mana nih kakak????
ditunggu yh :D
alowww Ipen..
BalasHapusasyik juga klo bisa buat cms sendiri, trus mana tutorial berikutnya...
qt tunggu ne,..;)
Trims b4
terimakasih atas ilmunya
BalasHapusdari www.robota.co.id
salam kenal
BalasHapusdi tunggu kunjungan baliknya
www.cahkos.com