WampServer
Apache, PHP, MySQL on Windows
Home forum
Back to WampServer
presentation
Downloads
Addons
Trainings
Alter Way
Go to Topic:
Previous
•
Next
Go to:
Forum List
•
Message List
•
New Topic
•
Search
•
Log In
•
Print View
PEAR script can't see DB
Posted by:
rheo
(---.wk.shawcable.net)
Date: September 29, 2006 08:41PM
I am trying to test PEAR with a simple script.
<?php
set_include_path(
get_include_path() .
PATH_SEPARATOR . 'c:\wamp\php\pear;'
);
require_once 'DB.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_name = 'spherc_beta';
$dsn = "mysql://$db_user:$db_pass@unix+$db_host/$db_name";
$db = DB::connect($dsn);
$db->setFetchMode(DB_FETCHMODE_OBJECT);
?>
This is the same DB information that I have in my phpmysqladmin which seems to be working just fine.
But the error I get is..
DB Error: not found
any ideas?
Options:
Reply
•
Quote
Re: PEAR script can't see DB
Posted by:
CyberSpatium
(67.170.181.---)
Date: September 29, 2006 09:12PM
change
$dsn = "mysql://$db_user:$db_pass@
unix
+$db_host/$db_name";
to
$dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";
Options:
Reply
•
Quote
Re: PEAR script can't see DB
Posted by:
rheo
(---.wk.shawcable.net)
Date: September 30, 2006 12:40AM
i've tried that now and no difference.
DB Error: not found
is there a path or an evironment variable maybe that needs to be set?
Options:
Reply
•
Quote
Go to:
Forum List
•
Message List
•
Search
•
Log In
Sorry, only registered users may post in this forum.
Click here to login