j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.
http://j4mie.github.com/idiormandparis/
2.01k stars 369 forks source link

How do I connect to MSSQL? #354

Closed treffynnon closed 4 years ago

treffynnon commented 4 years ago
protected static $_default_config = array(
            'connection_string' => 'sqlite::memory:',
            'id_column' => 'id',
            'id_column_overrides' => array(),
            'error_mode' => PDO::ERRMODE_EXCEPTION,
            'username' => null,
            'password' => null,
            'driver_options' => null,
            'identifier_quote_character' => null, // if this is null, will be autodetected
            'limit_clause_style' => null, // if this is null, will be autodetected
            'logging' => false,
            'logger' => null,
            'caching' => false,
            'return_result_sets' => false,
        );`

How can we connect to sql server

Originally posted by @Github743 in https://github.com/j4mie/idiorm/issues/350#issuecomment-550483444

treffynnon commented 4 years ago

@github743 I have moved your comment to a new issue. Please don't comment on other issues with unrelated questions or comments.

You need to specify a MSSQL connection string to the connection_string key in the configuration array you posted.

See: https://idiorm.readthedocs.io/en/latest/configuration.html#setup and the link to the PDO documentation on that page.