<?php
$con=ocilogon("system","ekosupriyanto","//localhost:1521/xe");
if (!$con)
echo "Gagal Terkoneksi Dengan Database Oracle";
else
echo "Koneksi Dengan Database Oracle Sukses";
?>
Insert PHP - ORACLE.
<html>
<head>
<title>Contoh Penggunaan Insert</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
$idsupplier=$_POST["idsupplier"];
$namasupplier=$_POST["namasupplier"];
$alamat=$_POST["alamat"];
$jeniskelamin=$_POST["jeniskelamin"];
$jumlah=$_POST["jumlah"];
$tanggalmasukbarang=$_POST["tanggalmasukbarang"];
$status=$_POST["status"];
$namasemen=$_POST["namasemen"];
$con=ocilogon("system","ekosupriyanto","//localhost:1521/xe");
if (($idsupplier<>"")&&($namasupplier<>"")&&($alamat<>"")&&($jeniskelamin<>"")&&($jumlah<>"")&&($tanggalmasukbarang<>"")&&($status<>"")&&($namasemen<>"")){
$sql=ociparse($con,"insert into tabel3 values('$idsupplier','$namasupplier','$alamat','$jeniskelamin','$jumlah','$tanggalmasukbarang','$status','$namasemen')");
ociexecute($sql);
}
$sql=ociparse($con,"select * from tabel3");
ociexecute($sql);
print("<table border=1>");
print("<th>ID_SUPPLIER</th><th>NAMA_SUPPLIER</th><th>ALAMAT</th><th>JENIS_KELAMIN</th><th>JUMLAH</th><th>TANGGAL_MASUK_BARANG</th><th>STATUS</th><th>NAMA_SEMEN</th>");
while (ocifetch($sql)){
print("<tr><td>");
echo ociresult($sql,"ID_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"NAMA_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"ALAMAT");
print("</td><td>");
echo ociresult($sql,"JENIS_KELAMIN");
print("</td><td>");
echo ociresult($sql,"JUMLAH");
print("</td><td>");
echo ociresult($sql,"TANGGAL_MASUK_BARANG");
print("</td><td>");
echo ociresult($sql,"STATUS");
print("</td><td>");
echo ociresult($sql,"NAMA_SEMEN");
print("</td></tr>");
}
print("</table>");
ocilogoff($con);
?>
<br>
<UPDATE DATA>
<form name="kirim" method="POST" action="">
ID Supplier <input type="text" name="idsupplier"> <br>
Nama Supplier <input type="text" name="namasupplier"> <br>
Alamat<input type="text" name="alamat"> <br>
Jenis Kelamin<input type="text" name="jeniskelamin"> <br>
Jumlah<input type="text" name="jumlah"> <br>
Tanggal Masuk barang<input type="text" name="tanggalmasukbarang"> <br>
Status<input type="text" name="status"> <br>
Nama Semen<input type="text" name="namasemen">
<input type="submit" name="Submit" value="TAMBAH DATA">
</form>
</body>
</html>
Update PHP - ORACLE.
<html>
<head>
<title>Contoh Penggunaan Update</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
$idSupplier=$_POST["idSupplier"];
$namaSemen=$_POST["namaSemen"];
$con=ocilogon("system","ekosupriyanto","//localhost:1521/xe");
if (($idSupplier<>"") && ($namaSemen<>"")) {
$sql=ociparse($con,"update tabel3 set NAMA_SEMEN='$namaSemen'
where ID_SUPPLIER='$idSupplier'");
ociexecute($sql);
}
$sql=ociparse($con,"select * from tabel3");
ociexecute($sql);
print("<table border=1>");
print("<th>ID_SUPPLIER</th><th>NAMA_SUPPLIER</th><th>ALAMAT</th><th>JENIS_KELAMIN</th><th>JUMLAH</th><th>TANGGAL_MASUK_BARANG</th><th>STATUS</th><th>NAMA_SEMEN</th>");
while (ocifetch($sql)){
print("<tr><td>");
echo ociresult($sql,"ID_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"NAMA_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"ALAMAT");
print("</td><td>");
echo ociresult($sql,"JENIS_KELAMIN");
print("</td><td>");
echo ociresult($sql,"JUMLAH");
print("</td><td>");
echo ociresult($sql,"TANGGAL_MASUK_BARANG");
print("</td><td>");
echo ociresult($sql,"STATUS");
print("</td><td>");
echo ociresult($sql,"NAMA_SEMEN");
print("</td></tr>");
}
print("</table>");
ocilogoff($con);
?>
<br>
<UPDATE DATA>
<form name="kirim" method="POST" action="">
Masukkan ID Supplier <input type="text" name="idSupplier"> <br>
Update Nama Semen <input type="text" name="namaSemen">
<input type="submit" name="Submit" value="UPDATE">
</form>
</body>
</html>
Where PHP - ORACLE.
<html>
<head>
<title>Contoh Penggunaan Where</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
$Nama_Supplier=$_POST["Nama_Supplier"];
?>
<form name="kirim" method="POST" action="">
Nama Supplier <input type="text" name="Nama_Supplier">
<input type="submit" name="Submit" value="Kirim">
</form>
<?php
if ($Nama_Supplier<>""){
$con=ocilogon("system","ekosupriyanto","//localhost:1521/xe");
$sql=ociparse($con,"select * from tabel3 where
Nama_Supplier='$Nama_Supplier'");
ociexecute($sql);
print("<table border=1>");
print("<th>ID SUPPLIER</th><th>NAMA SUPPLIER</th><th>ALAMAT</th><th>JENIS KELAMIN</th><th>JUMLAH</th><th>TANGGAL MASUK BARANG</th><th>STATUS</th><th>NAMA SEMEN</th>");
while (ocifetch($sql)){
print("<tr><td>");
echo ociresult($sql,"ID_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"NAMA_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"ALAMAT");
print("</td><td>");
echo ociresult($sql,"JENIS_KELAMIN");
print("</td><td>");
echo ociresult($sql,"JUMLAH");
print("</td><td>");
echo ociresult($sql,"TANGGAL_MASUK_BARANG");
print("</td><td>");
echo ociresult($sql,"STATUS");
print("</td><td>");
echo ociresult($sql,"NAMA_SEMEN");
print("</td></tr>");
}
print("</table>");
ocilogoff($con);}
?>
</body>
</html>
Delete PHP - ORACLE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<html>
<head>
<title>Contoh Penggunaan Delete</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
$idSupplier=$_POST["idSupplier"];
$con=ocilogon("system","ekosupriyanto","//localhost:1521/xe");
if ($idSupplier<>""){
$sql=ociparse($con,"delete from tabel3 where ID_SUPPLIER='$idSupplier'");
ociexecute($sql);
}
$sql=ociparse($con,"select * from tabel3");
ociexecute($sql);
print("<table border=1>");
print("<th>ID_SUPPLIER</th><th>NAMA_SUPPLIER</th><th>ALAMAT</th><th>JENIS_KELAMIN</th><th>JUMLAH</th><th>TANGGAL_MASUK_BARANG</th><th>STATUS</th><th>NAMA_SEMEN</th>");
while (ocifetch($sql)){
print("<tr><td>");
echo ociresult($sql,"ID_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"NAMA_SUPPLIER");
print("</td><td>");
echo ociresult($sql,"ALAMAT");
print("</td><td>");
echo ociresult($sql,"JENIS_KELAMIN");
print("</td><td>");
echo ociresult($sql,"JUMLAH");
print("</td><td>");
echo ociresult($sql,"TANGGAL_MASUK_BARANG");
print("</td><td>");
echo ociresult($sql,"STATUS");
print("</td><td>");
echo ociresult($sql,"NAMA_SEMEN");
print("</td><td>");
}
print("</table>");
ocilogoff($con);
?>
<br>
<UPDATE DATA>
<form name="kirim" method="POST" action="">
Masukkan ID SUPPLIER <input type="text" name="idSupplier">
<input type="submit" name="Submit" value="DELETE">
</form>
<body>
</body>
</html>
--------------------Selamat mencoba dan semoga bermanfaat-------------------