dimanche 6 décembre 2015

Query not assigned into the variable / Not going into the condition

I was doing this code for my project and it seems that I can't get the values of the query into $currentRow. All that saved into the variable $currentrow is 22 which is the number rows in the database. I want to have access to all the query results. Please help. Here's the code.

public function getBSIConfig(){
    $conn = oci_connect("472proj","system","//localhost/XE");
    $sql = oci_parse($conn,"SELECT conf_id, conf_key, conf_value FROM bsi_configure");
    oci_execute($sql);
    echo "0";
    while($currentRow = oci_fetch_all($sql,$res)){
        echo "1.5";
        echo $currentRow;
        if($currentRow["conf_key"]){
        echo "1";
            if($currentRow["conf_value"]){
                $this->config[trim($currentRow["conf_key"])] = trim($currentRow["conf_value"]);
                echo "2";
            }else{
                $this->config[trim($currentRow["conf_key"])] = false;
                echo "3";
            }
        }
    }
}

And the output is only:
0
1.5
22

Aucun commentaire:

Enregistrer un commentaire