Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PEAR] confirming installation
Bob Leitner wrote:

> All seemed fine until my script had to access the db - I get a DB
> Error: connect failed.

What does your DSN look like? If the regular mysql_* functions work,
then DB should work. I would think that it has to do with an error in
your code or DSN string.

Paste some code.

> If nothing else, how do I get more
> information regarding the error? Like did it fail because of credentials, 
or
> whatever?

$db = DB::connect($dsn);
if (DB::isError($db)) {
die($db->getMessage());
}

Is that what you're doing?

Aaron

Report this thread to moderator Post Follow-up to this message
Old Post
Aaron Wormus
08-26-04 01:56 PM


Re: [PEAR] confirming installation
Hi Aaron,

in one file I define the DSN, which is using the same variables as I use to
connect using php functions, which is:
$dsn = "mysql://$dbusername:$dbuserpassword@$dbhost/$default_dbname";


in another file I include the above file, have the require_once 'DB.php';,
and the connection call is:
$db = DB::connect($dsn);
if (DB::isError($db)) {
die ($db->getMessage());
}

$sql1 = "SELECT options FROM elements WHERE name = '$element_name'";

$result1 = $db->query($sql1);
if (DB::isError($result1)) {
die ($result1->getMessage());
}*/
$result1 = mysql_query($sql1);
if (!$result1) error_message(sql_error());

//$data1 = $result1->fetchRow(DB_FETCHMODE_ASSOC);

fairly straight forward, and it worked fine when everything was set up on my
local laptop. I thought it might have something to do with PEAR because I
can connect using the same variables with php funcitons.

Anything you see wrong? Or any other thoughts?

thanx,
bob


"Aaron Wormus" <aaron@wormus.com> wrote in message
news:412E14D0.1010902@wormus.com...
> Bob Leitner wrote:
> 
>
> What does your DSN look like? If the regular mysql_* functions work,
> then DB should work. I would think that it has to do with an error in
> your code or DSN string.
>
> Paste some code.
> 
credentials, or 
>
> $db = DB::connect($dsn);
> if (DB::isError($db)) {
> die($db->getMessage());
> }
>
> Is that what you're doing?
>
> Aaron

Report this thread to moderator Post Follow-up to this message
Old Post
Bob Leitner
08-27-04 01:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:53 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.