我想製作一個jqgrid,並且我想從mssql數據庫中放置兩個表格。 我做了一個.php但沒有工作,有人可以看秒爲什麼不工作? 我對這個東西neewbie ..如何在jqgrid上綁定mssql表格
代碼>
<?php
$myServer = "localhost";
$myUser = "root";
$myPass = "";
$myDB = "test";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");
// Declare the SQL query for Database
$query = "Select [Column 1]";
$query = "From table_test1";
//Execute the SQL query and return records
$result = mssql_query($query);
//Display the results
while($row = mssql_fetch_array($result))
//Close the connection
mssql_close($dbhandle);
?>
和jqGrid的代碼>
<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>
我得到這個錯誤>>
致命錯誤:調用未定義函數mssql_connect()在C:\ xampp \ htdocs \ Connect.php上線8
你確定你已經在擴展MSSQL切換? – Santhos 2014-09-23 08:44:19
你是什麼意思? – boggdan 2014-09-23 08:45:08