Perl and MySQL: How do I convert the Perl Database Program into...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • terryskorski
    New Member
    • Aug 2007
    • 1

    Perl and MySQL: How do I convert the Perl Database Program into...

    After reading the tutorial about the Perl Database Program:
    Perl Database Tut.

    I was wondering if anyone could help me have it interface with a MySQL database instead of storing information in a .cgi file. I understand DBI is most likely needed here, but I am a relatively new programmer when it comes to perl so I have no clue where a connection script would be needed where.
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    Originally posted by terryskorski
    After reading the tutorial about the Perl Database Program:
    Perl Database Tut.

    I was wondering if anyone could help me have it interface with a MySQL database instead of storing information in a .cgi file. I understand DBI is most likely needed here, but I am a relatively new programmer when it comes to perl so I have no clue where a connection script would be needed where.
    The quick answer to your question is that DBI is what you need.The slightly longer answer is that I do not know of any particular resource that I would point someone at in order to learn DBI. And I definitely do not know an easy and direct way in which to translate that example script for use with MySQL. I haven't ever seen that particular resource before.

    Anyway, all this is rather unhelpful I know. The best advise that I could give you is simply to install both MySQL and DBI (assuming you haven't already done so), and try to get a basic string to work for creating a database handle. This is definitely the hardest part of any work with DBI, but once this is rolling, basic queries are just that, basic.

    Good luck,
    - Miller

    Comment

    Working...