fatal Error

admin

Administrator
Staff member
Fatal error: Call to undefined function: ocilogon() in /data/htdocs/ora/ora4.php on line 6

<?php
print "<PRE>";
//$db = "btdev";

//$c1 = ocilogon("system","manager",$db);
$c1 = ocilogon("system@btdev", "manager");
//$c2 = ocinlogon("system","manager",$db);
$c2 = ocilogon("system@btdev", "manager");

function create_table($conn)
{ $stmt = ociparse($conn,"create table scott.hallo (test
varchar2(64))");
ociexecute($stmt);
echo $conn." created table\n\n";
}

function drop_table($conn)
{ $stmt = ociparse($conn,"drop table scott.hallo");
ociexecute($stmt);
echo $conn." dropped table\n\n";
}

function insert_data($conn)
{ $stmt = ociparse($conn,"insert into scott.hallo
values('$conn' || ' ' || to_char(sysdate,'DD-MON-YY HH24:MI:SS'))");
ociexecute($stmt,OCI_DEFAULT);
echo $conn." inserted hallo\n\n";
}

function delete_data($conn)
{ $stmt = ociparse($conn,"delete from scott.hallo");
ociexecute($stmt,OCI_DEFAULT);
echo $conn." deleted hallo\n\n";
}

function commit($conn)
{ ocicommit($conn);
echo $conn." commited\n\n";
}
}

function rollback($conn)
{ ocirollback($conn);
echo $conn." rollback\n\n";
}

function select_data($conn)
{ $stmt = ociparse($conn,"select * from scott.hallo");
ociexecute($stmt,OCI_DEFAULT);
echo $conn."----selecting\n\n";
while (ocifetch($stmt))
echo $conn." <".ociresult($stmt,"TEST").">\n\n";
echo $conn."----done\n\n";
}

create_table($c1);
insert_data($c1);

select_data($c1);
select_data($c2);

rollback($c1);

select_data($c1);
select_data($c2);

insert_data($c2);
commit($c2);

select_data($c1);

delete_data($c1);
select_data($c1);
select_data($c2);
commit($c1);

select_data($c1);
select_data($c2);


drop_table($c1);
print "</PRE>";
?>

This is just to test the connection of the oracle and php connection, could anyone help me....
 
Back
Top