in reply to Perl $dbh->prepare failed

Reading that statement sends off alarm bells. What do you mean by that statement? How are you going from one script to the other?

The error you are citing would lead me to believe that you are not preparing a statement against a valid database handle.

Of course... I'm taking pot shots in the dark here given I don't have any code to go on here...


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^2: Perl $dbh->prepare failed
by thil (Sexton) on Sep 12, 2006 at 12:45 UTC

    Yes.. I know. there isn't any code information attached to my question. simply because the codes are long and has a lot of sub routines coming from various Modules. :). sorry for that.

    Going from one script to another script means this,
    User first seeks for employers. That is the task of the first script. And from the result page, users can click on the employer name and go to the employer details page(second script). In the second script, the database handler is newly created if it is not alive.
          In the second script, the database handler is newly created if it is not alive.

      How are you testing for "alive?" Unless you are using mod_perl or some method of pooling your database handles I'd say you should be opening your handles unconditionally in your second script.


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

        actually I thought if the refernce is there(if I can print the reference with some hexadecimal code) the database connection is there.
        I am sort of a beginner and I didn't know that. And there's a high posibility that it is the place where I went wrong.
        Can you please suggest me a way to check whether the database connection is live or not.

        Thanks.