require_once ‘structures/datagrid.php’;
$datagrid=new Structures_DataGrid(2);
$options=array(‘dsn’=>“pdo://$username:$pw@hostname/$dbname”);
$sql=“select * from archives_user”;
$bind=$datagrid->bind($sql,$options);
database:mssql;
connect: pdo;
what’s wrong this code?
How does I correct it?
Thanks!
You tell us.
Are there any error messages, does it do what you ask? If not, how not?
error messages :“Unknown DataSource driver. Please specify an existing driver.”
But I have “MDB2_Driver_mssql” .
…but you appear to be specifing PDO in your options array.
$options=array(‘dsn’=>“mssql://$username:$pw@hostname/$dbname”);
It does not work!
Again, why not?
Have you tried the example provided by the manual? Introduce the error checking it employs, it will help you narrow down the problem.
<?php
$options = array(‘dsn’ => ‘mssql://user:password@host/db_name’);
$test = $datagrid->bind(‘SELECT * FROM my_table’, $options);
if (PEAR::isError($test)) {
echo $test->getMessage();
}
?>
Error message is Unknown DataSource driver,Please specify an existing driver.
Do you have the [fphp]MSSQL[/fphp] extension loaded?
Yes,I have already the mssql extension loaded!