Looking into the Quick installation topic we can see that jqGrid PHP does not create its own connection to the database, but uses a connection that already exists. This is very flexible in complex aplications where the connection to the database is alredy created.
In the future in our examples we will create the connection using PDO rules, but you should known that this is not neccessary.

PDO Driver

When a PDO driver is used a file named jqGridPdo.php should be included again with the main jqGrid.php.
Note that in this case you should not point which database should be used - MySQL or PosgreSQL. The script detect this automatically from the passed connection. Here is example

<?php // include the jqGrid Class require_once "php/jqGrid.php"; // include the PDO driver class require_once "php/jqGridPdo.php"; ... ?>

Microsoft SQL Driver

When a Microsoft SQL Server is used a file named jqGridSqlsrv.php should be included again with the main jqGrid.php.
In order to work properly with fields of type date when the connection is created you should set a special tag to the connection string
"ReturnDatesAsStrings"=>true.
The reason for this is that the driver by default handle dates as PHP date object.

Here is example:

<?php // Example connection $connectionInfo = array("UID" => 'user', "PWD" => 'password',"Database"=>"test", "ReturnDatesAsStrings" => true); $serverName = "localhost\SQLEXPRESS"; $conn = sqlsrv_connect( $serverName, $connectionInfo); ... // include the jqGrid Class require_once "php/jqGrid.php"; // include the SQL Server driver class require_once "php/jqGridSqlsrv.php"; ... ?>