There are two ways of doing this:
$req = "select xxx.nextval from dual";
$stm = OCIParse ($con, $req);
OCIExecute($stm, OCI_DEFAULT);
while (OCIFetch($stm)){
$x = OCIResult($stm,1);
}
or directly in your insert statement like this
$query = "INSERT INTO tasks (tname,tdesc,tid) VALUES ('$tname','$tdesc', wh1.tasks_seq.nextval )";