Skip to content

# Databases FAQs

### Q) For SQL Server demos, I get "mssqlnative extension not installed". Where do I get that extension so I can view that Demo?

Here is link from MS SQL Server website. http://www.microsoft.com/en-us/download/details.aspx?id=20098

You need to enable the extension in php after installation.

### Q) How to use mysqli or PDO extension?

Here is the config settings.

    $db_conf = array();
    $db_conf["type"] = "mysqli";
    $db_conf["server"] = "localhost"; // or you mysql ip
    $db_conf["user"] = "root"; // username
    $db_conf["password"] = "test"; // password
    $db_conf["database"] = "griddemo"; // database

    // include and create object
    $base_path = strstr(realpath("."),"demos",true)."lib/";
    include($base_path."inc/jqgrid_dist.php");
    $g = new jqgrid($db_conf);

After that, all calls will use mysqli extension.

For PDO extension,

    $db_conf = array();
    $db_conf["type"] = "pdo";
    $db_conf["server"] = "mysql:host=localhost";
    $db_conf["user"] = PHPGRID_DBUSER; // username
    $db_conf["password"] = PHPGRID_DBPASS; // password
    $db_conf["database"] = PHPGRID_DBNAME; // database

    include($base_path."inc/jqgrid_dist.php");
    $g = new jqgrid($db_conf);