problem with insert data to oracle using php
878005Jul 26 2011 — edited Aug 24 2011excuse me everyone, i am only beginner.
i wanna ask about my problem with php and oracle...i hope anyone in here can solved my problem...
my database : oracle 8i
php and apache: i am using PHP TRIAD
i have a problem with my php script, i dont know what cause my data can't insert to oracle and where is error in my script (because the browser not telling me about the error). this is my script :
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
this is my form script for insert data to oracle :
form_input.php
<table>
<form action="inputjuri.php" method="post">
<tr>
<td>No Juri</td>
<td>:</td>
<td><input name="no_juri" type="text" size="20" maxlength="30" /></td>
</tr>
<tr>
<td>Nama Juri</td>
<td>:</td>
<td><input name="nama_juri" type="text" size="100" maxlength="100" /></td>
</tr>
<tr>
<td height="52"></td>
<td></td>
<td><input type="submit" name="submit" value="SUBMIT" />
<input type="reset" name="reset" value="RESET" /></td>
</tr>
</form>
</table>
hope my form script is true....
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
and this is script when we submit data
inputjuri.php
<?php
error_reporting(E_ALL|E_STRICT);
include ('koneksi.php');
?>
<?php
$no_juri=$_POST['no_juri'];
$nama_juri=$_POST['nama_juri'];
$sqlstr= "insert into t_juri(NO_JURI,NAMA_JURI)values('$no_juri','$nama_juri')";
var_dump($sqlstr);
$sql=ociparse($conn,$sqlstr);
$cek = ociexecute($sql);
//ocicommit($conn);
if ($cek) {
echo "Proses simpan berhasil dilakukan";
}
else {
echo "Proses simpan gagal dilakukan";
$error = oci_error($sql);
var_dump($error);
}
?>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
and this is my struktur table in oracle
t_juri
CREATE TABLE T_JURI (
NO_JURI VARCHAR2 (5) NOT NULL,
NAMA_JURI VARCHAR2 (100),
PRIMARY KEY (NO_JURI)
USING INDEX
TABLESPACE USR PCTFREE 10
STORAGE (INITIAL 51200 NEXT 51200 PCTINCREASE 1))
TABLESPACE USR
PCTFREE 10
PCTUSED 40
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 51200
NEXT 51200
PCTINCREASE 1
MINEXTENTS 1
MAXEXTENTS 121
FREELIST 1 FREELIST GROUPS 1)
NOCACHE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
i don't know where is error in my script because the browser doesn't tell anything... only blank page is appear and my data doesn't insert...
hope anyone in here can solved my problem...
i already see another script in google but it doesn't help me (i am trying their script but always same like my script ---> data is not insert and error is not appear in my browser).
i am very confused now..
thank you
veetha
Edited by: 875002 on Jul 26, 2011 5:53 PM