Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlsrv describe method fetches DB-columns case-sensitive #79

Open
ghost opened this issue Oct 11, 2013 · 0 comments
Open

Sqlsrv describe method fetches DB-columns case-sensitive #79

ghost opened this issue Oct 11, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 11, 2013

Created by Dominik, 8th Aug 2012. (originally Lighthouse ticket #39):


I had a problem when changing from datasource dbo_oracle to dbo_sqlsrv, the DB-structure and its data for both ORACLE and SQL-server is the same:
The describe() method in file dbo_sqlsrv.php at line 234 returns the name of the field in upper letters. Before I started using dbo_sqlsrv I used dbo_mssql and dbo_oracle, but these drivers return field names in lower case, and therefore because of case-sensitive array-keys the following code "echo $data['MyModel']['field1']" would not work in sqlsrv but in mssql.

I actually fixed the problem near line 230:

    $fields = false;
    foreach ($cols as $column) {
        $field = strtolower($column[0]['Field']);                      // not that beautiful
        $fields[$field] = array(
            'type' => $this->column($column[0]['Type']),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant