DB Error in PEAR
Posted: Mon Jan 02, 2006 5:05 am
Happy new year to all of you.
I am new in PEAR. I installed it succesfully with DB & Mail Packages.
Now I write the following code to connect my mySQL database and run a simple query
[syntax=php]<?php
require_once("DB.php");
$db_user= "root";
$db_pass= "";
$db_host= "localhost";
$db_name= "xyz";
$dsn= "mysql://$db_user:$db_pass@$db_host/$db_name";
$db= DB::connect($dsn);
if(DB::isError($db))
{
die($db->getMessage());
}
else
{
$joke = $db->query("SELECT * FROM tbl_name");
while($row = $joke->fetch_row())
{
$arr[] = array('title' => $row['name']);
}
print_r($arr);
}
?>[/syntax]
When try run this code it is showing the following error
"[b]DB Error: not found[/b]"
I have no clue of this error. Please help me to run my first PEAR code successfully.
Thanks in advance
I am new in PEAR. I installed it succesfully with DB & Mail Packages.
Now I write the following code to connect my mySQL database and run a simple query
[syntax=php]<?php
require_once("DB.php");
$db_user= "root";
$db_pass= "";
$db_host= "localhost";
$db_name= "xyz";
$dsn= "mysql://$db_user:$db_pass@$db_host/$db_name";
$db= DB::connect($dsn);
if(DB::isError($db))
{
die($db->getMessage());
}
else
{
$joke = $db->query("SELECT * FROM tbl_name");
while($row = $joke->fetch_row())
{
$arr[] = array('title' => $row['name']);
}
print_r($arr);
}
?>[/syntax]
When try run this code it is showing the following error
"[b]DB Error: not found[/b]"
I have no clue of this error. Please help me to run my first PEAR code successfully.
Thanks in advance