You are here: problem:beginner connecting to database with pear « All PHP « IT news, forums, messages
problem:beginner connecting to database with pear

Posted by Osewoudt on 01/16/07 15:06

hello,

i am trying to work with pear.

i have made a script to connect to a database, but i get the following error
message:

Cannot connect: DB Error: connect failed


i checked de ini-file for the include path, this is correct:
include_path = ".;C:\Program Files\xampp\php\pear\"

the name of the database i want to connect to is 'products'.

(instead of username i have used a username, and instead of password i have
used a password)

------------ source code --------------

require_once("DB.php");

$dsn = "mysql://username:password@localhost/products";

$conn =DB::connect ($dsn);
if (DB::isError ($conn))
die ("Cannot connect: " . $conn->getMessage () . "\n");

--------------------------------------------------

i have no idea what i am doing wrong.


thanks,

henri

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация