Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: DBI fails to return an error code

by djten (Novice)
on Oct 09, 2011 at 02:21 UTC ( #930402=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost", $dbuid, $dbpw) || 
    +db_err("connecting to database", $sql, $DBI::err, $DBI::errstr);
    my $sql = "SELECT DCredits, Price, Description FROM $dbname.CUSTOMER_P
    +LAN WHERE Name='$planname'";
    ...
    }
    $sqlh->finish;
    $dbh->disconnect;
    
  2. or download this
    sub db_err
    {
    ...
      print "<p><i>Attempted command:</i> $psql</p>\n";
      print "<p><i>Error:</i> $perrnum - $perrstr</p>\n";
    }
    
  3. or download this
    ## Table
    CREATE TABLE `CUSTOMER_PLAN` (
    ...
    INSERT INTO `CUSTOMER_PLAN` VALUES(3, 'Seeker',  35, 18.75, 0.75, 'A',
    + '003', '<i>-noun.</i> An adventurous person who is seeking new exper
    +iences and new information to create a higher level of understanding 
    +and enlightenment.');
    INSERT INTO `CUSTOMER_PLAN` VALUES(4, 'Sage',    60, 47.00, 0.75, 'A',
    + '004', '<i>-noun.</i> A generous, lively person on the journey for t
    +he possession of wisdom and experience. This person is energetic, vib
    +rant and famed for health and wisdom.');
    INSERT INTO `CUSTOMER_PLAN` VALUES(5, 'Guru',   120, 89.00, 0.75, 'A',
    + '005', '<i>-noun.</i> A divine teacher. This person has vast knowled
    +ge and practices vibrant living while sharing with their community to
    + create a greater understanding and manifestation of truth and beauty
    +.');
    
  4. or download this
    There was a problem: executing query.
    Attempted command: SELECT DCredits, Price, Description FROM hlr.CUSTOM
    +ER_PLAN WHERE Name='Free'
    Error: 1054 - Unknown column 'DCredits' in 'field list'
    ...
    
  5. or download this
    There was a problem: executing query.
    Attempted command: SELECT DCredits, Price, Description FROM hlr.CUSTOM
    +ER_PLAN WHERE Name='Free'
    Error: - 
    ...
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930402]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-09-20 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (155 votes), past polls