Filling the grid using PHP and SQL Server 2000
Hi guys.
How can I get to fill a grid using data from a SQL Server 2000 database and PHP? I've got one example accessing MySql, I tried to use this one but I couldn't get good results.
In this MySql example there are those code lines:
<?
// grid object name
$name = "obj";
// SQL query
$query = "select * from `table` limit 0,20";
// database connection
$connection = mysql_connect("localhost", "user", "password");
mysql_select_db("database");
// query results
$data = mysql_query($query, $connection);
// add grid to the page
echo activewidgets_grid($name, $data);
?>
And it works very well. I try to change the code as follows:
<?
// grid object name
$name = "obj";
// SQL query
$query = "select * from `table`";
// database connection
$connection = mssql_pconnect("localhost", "user", "password");
mssql_select_db("database");
// query results
$data = mssql_query($query, $connection);
// add grid to the page
echo activewidgets_grid($name, $data);
?>
But, the grid always shows the message:
No data found.
Any ideas ???
How can I get to fill a grid using data from a SQL Server 2000 database and PHP? I've got one example accessing MySql, I tried to use this one but I couldn't get good results.
In this MySql example there are those code lines:
<?
// grid object name
$name = "obj";
// SQL query
$query = "select * from `table` limit 0,20";
// database connection
$connection = mysql_connect("localhost", "user", "password");
mysql_select_db("database");
// query results
$data = mysql_query($query, $connection);
// add grid to the page
echo activewidgets_grid($name, $data);
?>
And it works very well. I try to change the code as follows:
<?
// grid object name
$name = "obj";
// SQL query
$query = "select * from `table`";
// database connection
$connection = mssql_pconnect("localhost", "user", "password");
mssql_select_db("database");
// query results
$data = mssql_query($query, $connection);
// add grid to the page
echo activewidgets_grid($name, $data);
?>
But, the grid always shows the message:
No data found.
Any ideas ???
Fábio Ricardo Amalfi
May 24,