# I wanna to use mssql in zf3, how to config in global.php if I wanna to use the tablegateway as tutorial

**URL:** <https://discourse.laminas.dev/t/i-wanna-to-use-mssql-in-zf3-how-to-config-in-global-php-if-i-wanna-to-use-the-tablegateway-as-tutorial/898>\
**Category:** Components & MVC\
**Tags:** zend-db\
**Created:** [January 12, 2019, 8:12am UTC](https://discourse.laminas.dev/t/i-wanna-to-use-mssql-in-zf3-how-to-config-in-global-php-if-i-wanna-to-use-the-tablegateway-as-tutorial/898 "2019-01-12T08:12:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jobsfan](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/jobsfan/32/399_2.png) [@jobsfan](https://discourse.laminas.dev/u/jobsfan)\
**Post date:** [January 12, 2019, 8:12am UTC](https://discourse.laminas.dev/t/i-wanna-to-use-mssql-in-zf3-how-to-config-in-global-php-if-i-wanna-to-use-the-tablegateway-as-tutorial/898/1 "2019-01-12T08:12:26Z")

</div>

Generally, I use mysql as database, and config as follow in the global.php:

```
return [
    'db' => [
        'driver' => 'Pdo',
        'dsn' => 'mysql:dbname=dbname;host=localhost;charset=utf8',
    ],
];

```

and use the tablegateway according the official tutorial.

Recently I need to use mysql as database, I am just familiar to the tablegateway pattern the same as the official tutorial way. How could I config in the global.php and local.php?

Besides, if the configuration for the mssql is done, the usage of the tablegateway is the same? select, insert, update, delete, etc. as well as the paginator…

I found this page [https://github.com/zendframework/zendframework/issues/3142](https://github.com/zendframework/zendframework/issues/3142) mentioned about this, I will try it out.

---

<div class="post-metadata">

**Author:** ![samsonasik](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/samsonasik/32/777_2.png) [@samsonasik](https://discourse.laminas.dev/u/samsonasik)\
**Post date:** [January 16, 2019, 1:58am UTC](https://discourse.laminas.dev/t/i-wanna-to-use-mssql-in-zf3-how-to-config-in-global-php-if-i-wanna-to-use-the-tablegateway-as-tutorial/898/2 "2019-01-16T01:58:08Z")

</div>

In 2013, I used MSSQL in a project and it works fine with ‘Sqlsrv’ driver. I blogged about it about setting it up at [https://samsonasik.wordpress.com/2013/03/08/zend-framework-2-working-with-sql-server/](https://samsonasik.wordpress.com/2013/03/08/zend-framework-2-working-with-sql-server/) , while I’m not sure if it is still relevant right now

---

<div class="post-metadata">

**Author:** ![jobsfan](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/jobsfan/32/399_2.png) [@jobsfan](https://discourse.laminas.dev/u/jobsfan)\
**Post date:** [February 26, 2019, 3:56am UTC](https://discourse.laminas.dev/t/i-wanna-to-use-mssql-in-zf3-how-to-config-in-global-php-if-i-wanna-to-use-the-tablegateway-as-tutorial/898/3 "2019-02-26T03:56:06Z")

</div>

@samsonasik  
Thank you! I drop the plan to use mssql now. The project doesn’t need it any more.
