Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- koneksi
- <?php
- $host = "localhost";
- $user = "root";
- $password = "";
- $database = "db_ujian";
- $koneksi = mysql_connect($host,$user,$password);
- $pilihdb = mysql_select_db($database);
- ?>
- pengarang
- <?php
- include 'koneksi.php';
- $table = "CREATE TABLE tb_pengarang(
- kode_pengarang varchar (6) primary key,
- nama_pengarang varchar (35) not null,
- nama_buku varchar (50) not null,
- jeniskelamin enum ('P','L'),
- tahunterbit varchar (6) not null)";
- $isi = "INSERT INTO tb_pengarang VALUES
- ('0001','abu hanafi','sejarah','L','1998'),
- ('0002','rikky','mtk','L','2010'),
- ('0003','adam','geo','L','2003'),
- ('0004','fadhil','inggris','L','2009'),
- ('0005','diky','indonesia','L','1997')";
- $buat_table = mysql_query($table);
- if(!$buat_table){
- echo "gagal";
- }
- else{
- $isi_table = mysql_query($isi);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement