Hi..
I want to use the pear package.Pear is already on my xampp package.On the file php.ini the pear is included(I didn't change the file php.ini..there is a line like include_path = ".;c\xampp\php\PEAR").I used the following code to retrieve the results from database..But it is not working ..
<?php
// Include the appropriate PEAR classes
require_once("DB.php");
$dsn = array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'database' => 'emp',
'username' => 'root',
'password' => 'mysql'
);
$dbh = DB::connect($dsn);
$stmt = "SELECT id, name FROM examples ORDER BY id";
$result = $dbh->simpleQuery($stmt, DB_FETCHMODE_ASSOC);
if ($dbh->numRows($result) > 0) {
$data = (object) $dbh->fetchRow($result, DB_FETCHMODE_ASSOC);
echo "id => $data->id<br>\n";
echo "name => $data->name<br>\n";
}
?>
showing the errors like following ...
Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\divya\Pear-examples\dbconnect.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.;c\xampp\php\PEAR') in C:\xampp\htdocs\divya\Pear-examples\dbconnect.php on line 3
include_path = ".;c\xampp\php\PEAR"
Anybody knows plz help me to solve this...
Thanks