Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi...i'm new hear and was wondering if anyone could help me on getting started on how to write to a database after the HTML form as been completely filled up? Hope u could help me on this one..more power to you all...

Replies are listed 'Best First'.
RE: writing to a database
by jjhorner (Hermit) on Jun 20, 2000 at 17:05 UTC

    Pretty good question, but not one that should be asked here, right off. Look into the Apache::DBI and DBI in general, as well as SQL, etc. You have asked a very broad question, and I'm afraid we don't have that much time.

    The tutorials page has some good DBI information, not all related to html forms, but btrott's DBI logging example shows how to submit things to a database (one way).

    Look around, play with perldoc, pick up Programming the Perl DBI from O'Reilly, look at DevShed, and do a Google search.

    Good luck, and once you get some specific questions, let us know.

    Update:

    Dear me! I forgot to send you to merlyn's homepage! Go to his home node and click on the link.

    He always has some good stuff

    J. J. Horner
    Linux, Perl, Apache, Stronghold, Unix
    jhorner@knoxlug.org http://www.knoxlug.org/
    
Re: writing to a database
by Anonymous Monk on Jun 21, 2000 at 02:18 UTC
    Because we are running Perl 5.00502 on an NCR MP-RAS UNIX box. I had been avoiding compiling DBD::Informix for this machine but now I am going to give it another go. Thanks for the gentle nudge.
Re: writing to a database
by Anonymous Monk on Jun 21, 2000 at 01:03 UTC
    Another way is to use a Perl CGI script to call a C program which writes to the database. I am doing that right now with Informix ESQL/C. One problem...although the Perl script returns the correct HTML output when executed from the command line as user 'web' I get a database error when I call it from CGI under Apache as the same user. Anyone know why?
      Of course you can write a C-Wrapper to perform the database stuff, the question is: why? I think Perl has a DBD::Informix module.