Pada tutorial kali ini, Anda akan membuat:
- Database dan tabel users
- Konfigurasi database di Codeigniter
Sebelum mengikuti tutorial ini, pastikan Anda telah mengikuti tutorial ini:
- File hasil akhir Tutorial Bagian 2, silakan download di:https://drive.google.com/file/d/0B5BhV6c89_2YNFEwSzBnaGEwM2c/view?usp=sharing.
- Membaca Tutorial Codeigniter 3 – Membuat Halaman Login: Bagian 1 – Installasi dan Konfigurasi Awal Codeigniter 3
- Membaca Tutorial Codeigniter 3 – Membuat Halaman Login: Bagian 2 – Membuat Controller dan View Halaman Statis
Hasil akhir tutorial Bagian 3 ini bisa Anda download di: https://drive.google.com/file/d/0B5BhV6c89_2YYzhhbjVNZDFLZFk/view?usp=sharing.
Membuat database
Pastikan XAMPP (Apache dan MySQL) Anda telah berjalan.
- Buka browser Anda
- Lalu akses http://localhost/phpmyadmin
- Lalu klik menu Database
- Buat database baru dengan nama ci_login
- Kemudian klik tombol Create
- Tunggu beberapa saat sampai konfirmasi (Database ci_login has been created) muncul
Membuat tabel users
Tabel users akan berisi data-data user yang nantinya bisa login ke dalam sistem yang akan kita buat. Berikut spesifikasi tabel user:
Kolom | Type | Panjang | Keterangan |
id_user | INT | 11 | Primary Key, Auto_increment |
nama | VARCHAR | 100 | |
VARCHAR | 255 | ||
username | VARCHAR | 32 | Unique |
password | VARCHAR | 64 |
Berikut langkah-langkahnya:
- Klik database ci_login
- Lalu buat tabel baru. Pada input Create table name
- Name: users
- Number of columns: 5
- Klik tombol GO
- Lalu isi data-data berikut
- Klik tombol Save
Menambah satu user untuk login
Kita telah berhasil membuat database ci_login dan tabel users.
Langkah selanjutnya adalah menambahkan satu data user untuk contoh login nantinya.
- Buka database ci_login
- Lalu klik tabel users
- Kemudian klik tombol Insert
- Lalu masukkan data-data nama, email, username dan password
- Klik tombol GO
Konfigurasi database di Codeigniter
Langkah selanjutnya adalah melakukan konfigurasi database baik itu koneksi, library dan helper yang harus diload.
Konfigurasi database.php
- Buka file database.php di folder login/application/config
- Lalu ubah 3 hal ini:
‘username’ => ‘root’,
‘password’ => ”,
‘database’ => ‘ci_login’, - Simpan file
Konfigurasi autoload.php
Konfigurasi di autoload.php ini berfungsi untuk men-load library dan helper yang dibutuhkan.
- Buka file autoload.php di folder login/application/config
- Lalu pada setting $autoload[‘libraries’] = array(‘form_validation’,’session’);, tambahkan library database sehingga menjadi $autoload[‘libraries’] = array(‘form_validation’,’session’,’database’);
- Simpan file
Uji coba
Pastikan tidak deca 300 price ada kesalahan dalam proses setting konfigurasi database. Buka browser lalu akses http://localhost/login. Pastikan tidak ada error.
Download file hasil akhir
Hasil akhir tutorial Bagian 3 ini bisa Anda download di: https://drive.google.com/file/d/0B5BhV6c89_2YYzhhbjVNZDFLZFk/view?usp=sharing.
This blog was… how do you say it? Relevant!! Finally I’ve found something that helped me. Thank you!
Great web site you have got here.. It’s hard to find high quality writing like yours these days. I seriously appreciate people like you! Take care!!
Iza: I think I would raise hell, hahahaha!
Thanks for the good writeup. It in fact used to be a entertainment account it. Look complex to far delivered agreeable from you! However, how can we keep in touch?
Game perhaps provided by various resources, there is some traditional hack attributes which can be found in almost all hacks.
https://newsandinformationsite.wordpress.com bit.ly http://bit.ly/1sS55NVThere are so many games that we will not list them here. But you can also sit back and enjoy 15-30 second videos for 5 gems a pop which will allow you to purchase brand new vehicles as they become available after you beat select levels. While the initial days needed them to be purchased expensively, the launch of internet dawned a new era of computer and video gaming that made acquisition of games for entertainment purposes convenient and possible. http://Ow.ly/ goo.gl
Adam and Justin have created a system that is getting results and they are heavily invested in getting you success. And when he applied these techniques to improve his jump, he added 9-13 inches to the height of his jump. I have a broken arm at the moment so I won’t be having a top notch vert anytime soon… but after I get better I’m going to try vertshock and I will dive in full force to increase my vert.
Howdy! This article couldn’t be written any better! Reading through this post reminds me of my previous roommate! He always kept talking about this. I am going to forward this article to him. Fairly certain he will have a good read. I appreciate you for sharing!
An interesting discussion is worth comment. I think that you ought to write more on this topic, it may not be a taboo matter but typically people do not discuss these topics. To the next! Cheers!!
Wonderful goods from you, man. I’ve understand your stuff previous to and you are just extremely excellent. I actually like what you have acquired here, really like what you are saying and the way in which you say it. You make it enjoyable and you still care for to keep it sensible. I can’t wait to read far more from you. This is really a great site.
As gone over earlier, the mechanical section of your septic tank is very durable.
It’s an awesome post designed for all the internet viewers; they will take benefit from it I am sure.
Assalamualaikum.
Dibagian ini saya menjumpai error; In order to use the Session class you are required to set an encryption key in your config file
tolong penjelasannya, terima kasih.
Carolina14.
Detroit16.
After some mental debate, I am choosing to stay to my original parenting plan of letting her dictate her personal style. No one is forcing it on her.