Hi
I am scripting a php/oracle aplication and need to extract a value from my query and assign to a session variable, to control user privileges.
The extract() function work this way? any other way to extract the value?
Here is the code that is called from a form login and redirect to the right page, i do comment my attempt to use extract().
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
$name = $POST['user'];
$SESSION['user'] = $name;
$org = $POST['org'];
$user = $POST['user'];
$db_conn = ocilogon("xxx", "xxx", "xxx");
$cmdstr = "SELECT o.CLIENT, o.COD_OPER, o.SIST, o.COD_CLASS, o.NOME_OPER, f.NOME_FUNC, f.COD_TRANS, f.COD_FUNC FROM SCA_CAD_OPER o ,SCA_FUNC f WHERE o.SIST = 'SIST' AND o.CLIENT = '$org' AND o.COD_OPER = '$user' AND o.SIST = f.SIST AND o.COD_CLASS = f.COD_CLASS";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
//while($nrows >0){extract($nrows);}
//$_SESSION[nome_oper] = $NOME_OPER;
//session_register($NOME_OPER);
if($nrows>0){
header ("location: index1.php");
} else {
header ("location: index.htm");
}
OCIFreeStatement($cmdstr);
OCILogoff($db_conn);
?>
Thank“s in advance