It has been explained to me on the oracle site and I am binding that three variables that would change. I have this code and it seems to be right but it does not work, maybe someone can see whats wrong. I hope
when I echo $stmt;
I get "resource ID #3"
//define the query
$sql = '';
foreach($wcArray as $wc)
{
$sql .= "select '$wc' LOCATION, sum(Length) TOTAL from $wc:table where(work_loc>= :bdate and work_loc<= :edate) and rb_state <> 6 union\n";
}
$sql = substr($sql, 0, -6); //get rid of last "union"
//parse the query
$stmt = OCIParse($connection, $sql);
//Bind the values
oci_bind_by_name($stmt, ':table', $query3,9);
oci_bind_by_name($stmt, ':bdate', $query2,4);
oci_bind_by_name($stmt, ':edate', $query1,4);
//execute the query
OCIExecute($stmt);