Join the Conversation

3 Comments

  1. Hi Davide!

    I’m new to Phalcon and I need to connect to a MSSQL database. Do you have any examples on how to do that. I’ve been trying to use your connector, but unsuccessfully. Everytime I try to execute a query I get this message:

    Notice: Undefined index: pdoType in C:\xampp\htdocs\phalconmssql\app\library\Airaghi\PhalconPHP\MSSQL\Adapter\Mssql.php on line 225

    Any help you could give me would be appreciated!

    Thank you in advance

    Jorge Hernández

    1. you have to configure your database connection in app\config\config.php .

      Here an example:

      array(
      'adapter' => 'Airaghi\PhalconPHP\MSSQL\Adapter\Mssql',
      'host' => 'sql_server_ip',
      'username' => 'sql_server_username',
      'password' => 'sql_server_password',
      'dbname' => 'sql_server_db_name',
      'pdoType' => 'sqlsrv',
      'dialectClass' => 'Airaghi\PhalconPHP\MSSQL\Dialect\Mssql'
      ),
      'application' => array(
      'controllersDir' => __DIR__ . '/../../app/controllers/',
      'modelsDir' => __DIR__ . '/../../app/models/',
      'viewsDir' => __DIR__ . '/../../app/views/',
      'pluginsDir' => __DIR__ . '/../../app/plugins/',
      'libraryDir' => __DIR__ . '/../../app/library/',
      'cacheDir' => __DIR__ . '/../../app/cache/',
      'baseUri' => '/',
      )
      ));

      Replace sql_server_… with your connection info

Leave a comment