Tugas 8 Pemrograman Web C: Latihan MySQL
config.php: 1: <?php 2: $server = "sql305.byethost24.com"; 3: $user = "b24_32977667"; 4: $password = "000webhostampas"; 5: $nama_database = "b24_32977667_pendaftaran_siswa"; 6: $db = mysqli_connect($server, $user, $password, $nama_database); 7: if( !$db ){ 8: die("Gagal terhubung dengan database: " . mysqli_connect_error()); 9: } 10: ?> database.sql: 1: CREATE DATABASE `pendaftaran_siswa`; 2: CREATE TABLE `pendaftaran_siswa`.`calon_siswa` ( 3: `id` INT NOT NULL AUTO_INCREMENT , 4: `nama` VARCHAR(64) NOT NULL , 5: `alamat` VARCHAR(255) NOT NULL , 6: `jenis_kelamin` VARCHAR(16) NOT NULL , 7: `agama` VARCHAR(16) NOT NULL , 8: `sekolah_asal` VARCHAR(64) NOT NULL , 9: PRIMARY KEY (`id`) 10: ) ENGINE = InnoDB; 11: INSERT INTO `calon_siswa` (`id`, `nama`, `alamat`, `jenis_kelamin`, `agama`, `sekolah_asal`) VALUES (NULL, 'Lia', 'Jl. Mangga No...