zeezack Posted April 18, 2008 Share Posted April 18, 2008 I'm trying to query and fetch some results from an Oracle database... $VAR=1; //test if($dbs[0][1]=="EBS") { $sql = "SELECT $fldso"; $sql .= " FROM ( SELECT $alias_flds, rownum r"; $sql .= " FROM ( SELECT $flds_b"; $sql .= " FROM $k"; $sql .= " ORDER BY $indxflds"; //if scalar @idx_key > 0; $sql .= " ) alias WHERE rownum <= $VAR )"; // $recs_page $sql .= " WHERE r > $VAR"; // $recs_start } echo'<p><b>SELECTION SQL FOR GRABBING DATA</b></p>'; echo'<p>'.$sql.'</p>'; unset($fldso); unset($alias_flds); unset($flds_b); unset($indxflds); $numr=ociparse($c,$sql); ociexecute($numr); $check_num_records = ocinumcols($numr); echo''.$check_num_records.' - CHECK'; //pull out the number of records. echo'<br/>Results<br/>'; //if($check_num_records==0) //{ // echo'Currently, there is nothing in '.$k.'.',"\n"; //} //else // { while($arrayBlob = oci_fetch($numr)) { echo'test MAINS'; echo $arrayBlob['CONTRACT_FILE']->load(); } OCISetPrefetch($numr, 100); while ($succ = OCIFetchInto($numr, $row)) { foreach ($row as $item) { echo $item." "; } echo "<br>\n"; } while ($row = ocifetchstatement($numr, &$arr)) { echo'BIG TEST WOOOOOO HOOO '.$row[0].'<br/>'; echo'BIG TEST WOOOOOO HOOO '.$arr[0].'<br/>'; if($sql_mode==1) { $real_results[$m]= $row; //place ONLY SQL mode 1 results from table into array } for($i=0;$i<=$n-1;$i++) { $trv.="'$row[$i]', "; // a,b,c, - this makes a string with the results for each coloumn it finds... col1, col2, col3, } $trv =substr($trv,0,-2); //remove the comma from the last variable $trv = "($trv)"; // (a,b,c) - these results are placed into this format then put into an array. $mass_result[] = $trv; unset($trv); } Quote Link to comment Share on other sites More sharing options...
zeezack Posted April 18, 2008 Author Share Posted April 18, 2008 little help here fellas Quote Link to comment Share on other sites More sharing options...
zeezack Posted April 18, 2008 Author Share Posted April 18, 2008 How come I am unable to get any results? It is almost as if the commands are not working? Quote Link to comment Share on other sites More sharing options...
zeezack Posted April 21, 2008 Author Share Posted April 21, 2008 Not sure what is wrong still guys. Please help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.