php - how to tie mssql table on jqgrid -
i want make jqgrid , want put there 2 tables mssql database. made .php didn't work, can watch sec why dosen't work? i'm neewbie on thing..
code>
<?php $myserver = "localhost"; $myuser = "root"; $mypass = ""; $mydb = "test"; //connection database $dbhandle = mssql_connect($myserver, $myuser, $mypass) or die("couldn't connect sql server on $myserver"); //select database work $selected = mssql_select_db($mydb, $dbhandle) or die("couldn't open database $mydb"); // declare sql query database $query = "select [column 1]"; $query = "from table_test1"; //execute sql query , return records $result = mssql_query($query); //display results while($row = mssql_fetch_array($result)) //close connection mssql_close($dbhandle); ?>
and jqgrid code>
<html> <head> <title id='description'>expedio weekly tickets</title> <script src="js/jquery-1.11.0.min.js" type="text/javascript"></script> <script src="js/i18n/grid.locale-en.js" type="text/javascript"></script> <script src="js/jquery.jqgrid.min.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="style/redmond/jquery-ui.min.css"/> <script type="text/javascript"> $(document).ready(function (){ $("#grid").jqgrid({ data: mydata, datatype: 'local', width: 1320, colnames: ["a", "b", "c"], colmodel: [ {name: 'a', index: 'a', key: true, width:10}, {name: 'b', index: 'b', width:20}, {name: 'c', index: 'c', width:40} ], pager: '#pager', sortname: 'id', viewrecords: true, sortorder: "asc", caption: "test" }); }); </script> </head> <body> <table id="grid"></table> <div id="pager"></div> </body> </html>
i error>>
fatal error: call undefined function mssql_connect() in c:\xampp\htdocs\connect.php on line 8
the error caused because of missing php extension communication mssql. read how install mssql extension in php manual here:
http://php.net/manual/en/mssql.setup.php - sections requirements , installation
Comments
Post a Comment