i am having a bit of trouble working out how to use PHP and call an oracle stored procedure.
Running the following command directly on SQL developer gives me the results I need:
variable O_username varchar2;
EXECUTE LOGINADMIN('John','John', 'Attractions', :O_username);
print O_username;
However on PHP I am having trouble getting the results I require. This is my PHP code.
include 'connection.php';
$username = ($_POST['uname']);
$password = ($_POST['pass']);
$role = ($_POST['admin_role']);
$query = "EXECUTE LOGINADMIN(:bind1,:bind2, :bind3, :bind4);
";
oci_bind_by_name($stmt, ":bind1", $username);
oci_bind_by_name($stmt, ":bind2", $password);
oci_bind_by_name($stmt, ":bind3", $role);
oci_bind_by_name($stmt, ":bind4", $result, 50);
$stmt = oci_parse($conn, $query);
oci_execute($stmt);
while ($row=oci_fetch_row($stmt))
$count = oci_num_rows($stmt);
ECHO $stmt;
ECHO $result;
echo OCI_RESULT ($stmt);
if ($count > 0 && $role == 'Attractions' ) {
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Logged Succesfully!')
window.location.href='attractionshome.php'
</SCRIPT>");
$_SESSION['attractionlogin'] = $username;
exit();
It looks like I am having some trouble getting the input out so $result can see there is a variable for this.
thank you,