PHP+Oracle problem - oci_fetch_all() fails for certain schema

Discussion in 'PHP' started by obay_wapo, Sep 1, 2009.

  1. #1
    PHP+Oracle problem - oci_fetch_all() fails for certain schema


    Hi all,

    I have a weird problem with PHP + Oracle.

    Within my PHP program, I have a function which executes all queries:

    //all queries are executed by this function
    //simplified for readability
    function query($db, $query) {
    	$result = array();
    	$parse_result = oci_parse($db, $query);
    	$execute_result = oci_execute($parse_result, OCI_DEFAULT);
    	$result["count"] = oci_fetch_all($parse_result, $result["result"]);
    	return $result;
    }
    Code (markup):
    I have an Oracle DB in the backend, which I manage with PL/SQL.

    Schemas: A, B, C, D
    Users (Roles): E (Role1)
    Role1 has SELECT privilege on A, B, C, D

    Everything works fine in PL/SQL. But my problem is that, my query() function above stops / terminates at oci_fetch_all() for any table in schema D. I know it terminates there because I have logging. It never gets past that line. It just simply terminates whenever I do SELECTs on schema D.anyTable. I tried copying my queries on D.anyTable into PL/SQL and they work. So that rules out the possibility of insufficient privileges.

    What am I missing?

    Thanks for your time!
     
    obay_wapo, Sep 1, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you have error reporting on?

    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    
    PHP:
    Is this a big query that generally takes multiple seconds to return a response or not?
     
    premiumscripts, Sep 1, 2009 IP
  3. obay_wapo

    obay_wapo Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I changed the query into a simple one

    SELECT * FROM D.TableName
    Code (markup):
    and it still doesn't work.

    I'm not in the office now so I'll try error_reporting(E_ALL) first thing tomorrow.

    Thanks much!!
     
    obay_wapo, Sep 1, 2009 IP