I'm a beginner in PHP.
<?php
include("phpgrid-full-v1.5.2/lib/inc/jqgrid_dist.php");
$db_conf = array();
$db_conf["type"] = "odbc_mssql";
$db_conf["server"] = "Driver={SQL Server};Server=ip:port;Database=dbname;";
$db_conf["user"] = "userid";
$db_conf["password"] = "password";
$db_conf["database"] = "dbname";
$g = new jqgrid($db_conf);
$grid["caption"] = "Sample Grid";
$g->set_options($grid);
$g->set_actions(array("inlineadd"=>true));
$g->select_command = "select * from dbTable";
// render grid
$out = $g->render("list1");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/redmond/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>
<script src="../../lib/js/jquery.min.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="../../lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
</head>
<body>
You must have SQL Server installed: for this demo. Also set database credentials in this demo.
<div style="margin:10px">
<?php echo $out?>
</div>
</body>
</html>
This code always yields :You must have SQL Server installed: for this demo. Also set database credentials in this demo.
I have SQL server installed and my credentials work when I setup an windows ODBC but it doesn't seem to be the case with PHP.
Also is there any sql server prep that I need to do set this up?
NP
Hello,
Configuration seems fine … i tested the scenario with odbc_mssql with following config.
$db_conf = array();
$db_conf["type"] = "odbc_mssql";
$db_conf["server"] = "Driver={SQL Server};Server=(local)sqlexpress;Database=master;";
$db_conf["user"] = null;
$db_conf["password"] = null;
$db_conf["database"] = null;