I have xampp and I wrote this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pear</title>
</head>
<body>
<?php
require 'DB.php';
$db = DB::connect('mysql://root@localhost/asd');
$query = "select * from asd";
$result = $db->query($query);
while($raw = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
echo $row['1'] , " ";
echo $raw['2'], "<br>";
}
?>
</body>
</html>
But when I opened the file on localhost it wrote:
Fatal error: Class 'PEAR_Error' not found in C:\xampp\php\pear\DB.php on line 947.
I reinstalled "DB" and checked if pear is installed and everything was ok.