<p> <h1 style
align="center">perpustakaan</h1></p>
<form action="input.php"
method="POST">
<table border="1" style
align="center">
<tr>
<td>id</td>
<td><input type="text"
name="id"></td>
</tr>
<tr>
<td>nama</td>
<td><input type="text"
name="nama"></td>
</tr>
<tr>
<td>Jml</td>
<td><input type="text"
name="jml"></td>
</tr>
<tr>
<td><input type="submit"
value="input"></td>
<td><input type="reset"
value="hapus"</td>
</tr>
2. Buat program connect.php
<?php
$connect =
mysql_connect("localhost","root","");
mysql_select_db("perpustakaan");
if($connect){
echo "BERHASIL";
}else{
echo "GAGAL";
}
?>
3. Buat program input.php
<?php
include "connect.php";
mysql_query("INSERT INTO buku(id, nama,
jml)
values('$_POST[id]','$_POST[nama]','$_POST[jml]')");
?>
4. Buat database masuk ke localhos/phpmyadmin kemudian buat database perpustakaan
5. Database buku
6. Kemudian buat field id,nama,jml
7. Running xampp apace dan mysql kemudian jalan kan program form.php di browser
masukan data
8. Output Database
Tidak ada komentar:
Posting Komentar