Hello all,
I would welcome some suggestions for the following code: These function seem to work off and on , I must be missing something somewhere ...
I have to files
file 1 like so
<?php
include("../db/connect_db.php");
$conn = CILogon($user,$password,$db);
include("../functions/container.php");
if (is_box_prepped($container_tag)=='true')
{
$url = "prep_container_2.php?prep_method=".$prep_method."&txtScan=".$reagent_id."&prep_method_long=".$prep_method_long."&color=".$color."&weight_yn=".$weight_yn;
pop_error_box("This box contains containers which are already prepped!",$url);
}
?>
file 2 isn this case "container.php"
function is_box_prepped($myTag){
$query = "SELECT COUNT(PREP_METHOD) AS CNT FROM CONTAINER_TABLE WHERE QC_CASE_NO='".$myTag."'";
$stmt = @OCIParse($conn, $query);
@OCIExecute($stmt);
@OCIFetch($stmt);
$BOX_PREPPED_CNT = @OCIResult($stmt, "CNT");
@OCIFreeStatement($stmt);
if ($BOX_PREPPED_CNT=="0")
{
return 'false';
}
else
{
return 'true';
}
}
The function is_box_prepped does not return the value correctly. When I echo the query in the included file, it is complete, including the passd variable. I can even run the query in PL/SQL and get the right result. But the function does not return it ....
Anyone??
TIA
Matthias