divyakrishnan Posted September 20, 2010 Share Posted September 20, 2010 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 PHP Syntax // 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 What should I do..Shall I install the Pear package se-perately?How should I configure it?Plz Help me..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.