I had to take over code from someone that died.
They had this in the code:
my @_mb = $dbh->tables;
my $_tablesAffected = 0;
foreach $_k (@_mb) {
# Ran code in here...
}
It appears the $dbh->tables is no longer working.
They were running through the tables in that foreach, pulling the tables in:
my $_sql = "select * from $_k LIMIT 0";
my $sth2 = $dbh->prepare($_sql);
$sth2->execute();
my @_mb2 = @{$sth2->{NAME}};
foreach $_k2 (@_mb2) {
# then looking for column names with username:
if($_k2 =~ /username/i) {
# do what they are looking for
}
next;
}
So since that is no longer working, how can they run through the database like that, looking for the tables with the column they are looking for?
It is for people who want to change their username to something else, the programming programmed everything together by the username, because they said they would never allow changes, but they had so many requests, they changed their mind, so now, they have to be changed, so need to look through the tons and tons of tables, in case it is somewhere.
The server was upgraded and it quit working, I think it is because that $dbh->tables no longer works.
Can someone point to me on how to use the new catalog in that to make it work again?
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.