Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Database problem

by graff (Chancellor)
on Aug 06, 2005 at 16:10 UTC ( [id://481509]=note: print w/replies, xml ) Need Help??


in reply to Database problem

When I call the schript from one place everything works fine and when I call it from another place (in exactly the same way) there are no results comming back from the database. When I do a print of the database Query and past that into phpmyadmin for testing, everything works fine, also with the query that does not return the data...

In the posted code, you are not doing any error checking on the DBI->connect call, so based on what you say the problem is, I'd guess that when running it from "another place", the connection is failing.

Try writing your connect call in this form, and see what happens:

$db_homenet = DBI->connect( ... ) or die "DBI connect failed: $DBI::er +rstr";

While you're at it, look at the DBI man page about the "RaiseError" attribute (which you set via the connect call), and/or consider adding error traps at each of the "prepare" and "execute" calls.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://481509]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found