thanks, that's a lot of good info.
maybe I can ask you another q :-)
I am running this query, and it works fine in mySQL, i.e. md contains the right datetime value in mySQL. however, I don't believe mt is getting assigned md's value
my $check_inv_sql = "SELECT MAX(cdt) AS md FROM s_i ORDER BY cdt LIMIT
+ 1";
$sth=$dbh->prepare($s_query) or die $dbh->errstr;
$sth->execute;
my $mt;
if (my $hash_ref = $sth->fetchrow_hashref)
{
$mt = $hash_ref->{'md'};
print "$mt\n";#this returns below error
}
and the error it generates is
Use of uninitialized value $mt in concatenation (.) or string at Sb.pl
+ line 56.
It seems to me that I am not assigning md correctly to $mt. If that is indeed the case, how do I correct the above code....thx!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.