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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|