Welcome Guest, Not a member yet? Register   Sign In
stdClass/row array results to uppercase
#7

[eluser]inari[/eluser]
Well, I was little in hurry so I fixed it by myself. This fix works only for PHP 5.


To get object attributes lowercase do next:

1. go to db_result.php near line 75
2. find method result_object()
3. change:
Code:
while ($row = $this->_fetch_object())
        {
            $this->result_object[] = $row;
        
        }
with:
Code:
while ($row = $this->_fetch_object())
        {
            $new_row = array();
            foreach ($row as $key => $value) {
                    $new_row[strtolower($key)] = $value;
            }
            $this->result_object[] = (object) $new_row;
        
        }

And for getting result as array:

1. open oci8_result.php
2. find method result_array()
3. change:

Code:
while ($this->_fetch_assoc($row))
        {
            
            $this->result_array[] = $row;
        }

with:

Code:
while ($this->_fetch_assoc($row))
        {
            
            $new_row = array();
            foreach ($row as $key => $value) {
                    $new_row[strtolower($key)] = $value;
            }
            
            $this->result_array[] = $new_row;
        }


Messages In This Thread
stdClass/row array results to uppercase - by El Forum - 03-19-2008, 09:43 AM
stdClass/row array results to uppercase - by El Forum - 03-19-2008, 10:08 AM
stdClass/row array results to uppercase - by El Forum - 03-19-2008, 11:45 AM
stdClass/row array results to uppercase - by El Forum - 03-19-2008, 01:17 PM
stdClass/row array results to uppercase - by El Forum - 03-19-2008, 01:23 PM
stdClass/row array results to uppercase - by El Forum - 04-23-2008, 12:45 PM
stdClass/row array results to uppercase - by El Forum - 04-23-2008, 01:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB