Saturday, May 27, 2017

Simple?

function get_max_or_weight_from_itemsubjid_and_criteria_id($conn,$itemsubjid,$criteria_id)
{
$sql = “SELECT max_or_weight FROM assessment_items_criteria WHERE itemsubjid=$itemsubjid AND criteria_id=$criteria_id”;
$stmt = ociparse($conn,$sql);
ociexecute($stmt,OCI_DEFAULT);
ocifetchinto($stmt, &$result_array);
if ( sizeof($result_array) > 0 )
return $result_array[0];
else
return 0;

}
Such exquisite beauty in such a simple function. 
/me rubs tears of joy from eyes
Hmm…solving a coding problem that’s been bugging you for a long time
is very much like having a big fat line of coke. Not that I would know
of course.