in reply to Database Output

First of all you shouldn't quote the the placeholder in the SQL statement:  = ? instead of = '?'

And you should use the RaiseError => 1 option during DBI->connect, because you seem to ignore errors from DBI, which makes debugging harder.

You need to prepare the statement only once, but probably ->execute for each cookie value - though it's hard to understand what you actually want to achieve, because you only show non-working code, and don't verbally describe what you want to achieve in the end.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Database Output
by Anonymous Monk on Oct 11, 2010 at 15:57 UTC
    Hi, Thank you, I'll fix the errors that you mentioned. I'm trying to 1) get the value of a cookie; 2) use the value to determine the db row; 3) get two fields from that row; and 4) make the value of the fields into scalars.
      1) get the value of a cookie

      Then do it once. I see three calls that are supposed to obtain the cookie value, although it's stored in a variable after the first call. <blcoqkuote>2) use the value to determine the db row;

      I believe that's what you do when fix the errors I mentioned

      3) get two fields from that row; and 4) make the value of the fields into scalars.

      Looks like the code is doing that too. What problems remain in that code?

      Perl 6 - links to (nearly) everything that is Perl 6.