I have successfully installed pear but it is not connecting to my mysql database and it is not giving an error.
The first script doesnt go beyond DB::Connect and doesnt display hello 1.
The second script(pure php) displays both hello1 and results of the query.
what could be the problem
<?php
require_once 'DB.php';
$uname = 'root';
$hostn = 'localhost';
$db_name = 'employees';
$connection ="mysql://$uname:@$hostn/$db_name";
$db =& DB::connect($connection);
echo "hello1";
if (DB::isError($db))
{ echo $db->getDebugInfo();
}
echo "hello2";
?>
<?php
$uname = "root";
$hostn = "localhost";
$db_name = "employees";
$db = mysql_connect($hostn,$uname);
mysql_select_db($db_name,$db);
$result = mysql_query("SELECT * FROM employees",$db);
echo "hello1\n";
printf("First Name: %s<br>\n", mysql_result($result,0,"first"));
printf("Last Name: %s<br>\n", mysql_result($result,0,"last"));
printf("Address: %s<br>\n", mysql_result($result,0,"address"));
printf("Position: %s<br>\n", mysql_result($result,0,"position"));
?>