DB error: extension not found
| From: | bart craenen | Date: | Wed, 05 May 2004 22:41:22 +0000 |
| Subject: | DB error: extension not found | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12322@lists.php.net to get a copy of this message | ||
Can anyone help me on this:
the following code should make a connection with the SQL server located on my own PC. (tested on someone elses PC) the login and password are the ones that have been set to make the connection between the SQL enterprise manager and the server (so i guess they should work) and the database exists.
<?php
function connection(){
require_once 'DB.php';
$dsn = 'mssql://bart:bart@localhost/SMI';
$db =& DB::connect($dsn);
if (DB::isError($db)) {
/*
* This is not what you would really want to do in
* your program. It merely demonstrates what kinds
* of data you can get back from error objects.
*/
echo 'Standard Message: ' . $db->getMessage() . "\n";
echo 'DBMS/User Message: ' . $db->getUserInfo() . "\n";
echo 'DBMS/Debug Message: ' . $db->getDebugInfo() . "\n";
exit;
}
return $db;
}
function sql ($query){
$db=connection();
$result =& $db->query($query);
// Always check that $result is not an error
if (DB::isError($result)) {
die ($result->getMessage());
}
$db->disconnect();
}
function get_data($query){
$db=connection();
$result =& $db->query($query);
// Always check that $result is not an error
if (DB::isError($result)) {
die ($result->getMessage());
}
$row =& $result->fetchRow(DB_FETCHMODE_OBJECT);
return $row;
$db->disconnect();
}
?>
but i keep getting the following error message
Standard Message: DB Error: extension not found DBMS/User Message: mssql://bart:bart@localhost/SMI DBMS/Debug Message: mssql://bart:bart@localhost/SMI
_________________________________________________________________
Vraag van de week: Welk soort project zou jij financieel ondersteunen? http://www.msn.be/microsoft/potential/default.asp