Page 1 of 1

Help with PHP and query

Posted: Sun May 02, 2010 8:19 am
by gammaman
When I execute the following query and print_r the result, I get a resource #id 4 error

Code: Select all

if($id == "contract"){
	
$itemNum = $_POST['itemNo'];
foreach($itemNum as $key=>$value) {
    if (!empty($value)) {
     $item[] = $value;
  }
    }
$itemC = count($item);   //this has a count of 1
print_r($itemC);    // 1
print_r($item);    // [0] > 1009
for($i=0;$i<$itemC;$i++)
{
$contrAmt = oci_parse($conn, 'select contrAmt from tosupply where contractNum = '.$_SESSION['contr'].' AND itemNo = '.$item[$i].' ');	

print_r($contrAmt);   //get a resource error,   should be seeing result of query  
}



Re: Help with PHP and query

Posted: Sun May 02, 2010 2:35 pm
by requinix
oci_parse doesn't actually run the query. You need oci_execute for that.