2. buat table admin
CREATE TABLE `admin` (
`kd_admin` varchar(10) NOT NULL,
`nama_admin` varchar(50) NOT NULL,
`pswd_admin` varchar(50) NOT NULL,
`hp_admin` varchar(13) NOT NULL,
`email_admin` varchar(30) NOT NULL,
`img_admin` varchar(100) NOT NULL,
PRIMARY KEY (`kd_admin`)
)
`kd_admin` varchar(10) NOT NULL,
`nama_admin` varchar(50) NOT NULL,
`pswd_admin` varchar(50) NOT NULL,
`hp_admin` varchar(13) NOT NULL,
`email_admin` varchar(30) NOT NULL,
`img_admin` varchar(100) NOT NULL,
PRIMARY KEY (`kd_admin`)
)
3. buat table kategori
CREATE TABLE `kategori` (
`id_kategori` int(4) NOT NULL AUTO_INCREMENT,
`nama_kategori` varchar(30) NOT NULL,
PRIMARY KEY (`id_kategori`)
)
`id_kategori` int(4) NOT NULL AUTO_INCREMENT,
`nama_kategori` varchar(30) NOT NULL,
PRIMARY KEY (`id_kategori`)
)
4. buat table berita
CREATE TABLE `berita` (
`id_berita` int(11) NOT NULL,
`kd_admin` varchar(10) NOT NULL,
`id_kategori` int(4) NOT NULL,
`st_berita` varchar(6) NOT NULL,
`tgl_berita` date NOT NULL,
`jam_berita` time NOT NULL,
`judul_berita` varchar(100) NOT NULL,
`isi_berita` text NOT NULL,
`img_berita` varchar(100) NOT NULL,
PRIMARY KEY (`id_berita`)
)
`id_berita` int(11) NOT NULL,
`kd_admin` varchar(10) NOT NULL,
`id_kategori` int(4) NOT NULL,
`st_berita` varchar(6) NOT NULL,
`tgl_berita` date NOT NULL,
`jam_berita` time NOT NULL,
`judul_berita` varchar(100) NOT NULL,
`isi_berita` text NOT NULL,
`img_berita` varchar(100) NOT NULL,
PRIMARY KEY (`id_berita`)
)
Cara membuat table dari console:
1. buka phpmyadmin
2. copy script pada console
3. jika sudah untuk menjalankan Ctrl+Enter
Tidak ada komentar:
Posting Komentar