sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use warnings; use Mysql; use CGI qw/:standard/; my $query = CGI->new; my %form = $query->Vars; my $entries = "entries.txt"; my $dbh = Mysql->connect($poemDB, sulfericacid, ----); $dbh->selectdb($poemDB); print "Database content\: $dbh"; my $rc = $dbh->shutdown(); if ($form{'poemtitle'} && $form{'poemsub'}) { open (ENTRIES, ">> $entries") or die "Cannot open $entries"; print ENTRIES "$form{'poemtitle'}\n"; print ENTRIES "$form{'poemsub'}\n"; close (ENTRIES); print header(), start_html('Success'), "Your poem entitled <b>$form{'poemtitle'}</b> has been added\n", end_html(); } else { print header(), start_html('Poetry Submissions'), ######### start_form, "Submission Title",textfield('poemtitle'),p, "Submission",textarea(-name=>'poemsub', -rows=>10, -columns=>50), submit, end_form, hr, end_html(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: My first MySQL database
by merlyn (Sage) on Feb 10, 2003 at 19:03 UTC | |
by sulfericacid (Deacon) on Feb 10, 2003 at 19:04 UTC | |
by merlyn (Sage) on Feb 10, 2003 at 19:06 UTC | |
by sulfericacid (Deacon) on Feb 10, 2003 at 19:13 UTC | |
by merlyn (Sage) on Feb 10, 2003 at 19:15 UTC | |
|
Re: My first MySQL database
by l2kashe (Deacon) on Feb 10, 2003 at 19:04 UTC | |
by sulfericacid (Deacon) on Feb 10, 2003 at 19:10 UTC | |
|
Re: My first MySQL database
by jobber (Sexton) on Feb 10, 2003 at 18:51 UTC | |
by sulfericacid (Deacon) on Feb 10, 2003 at 19:03 UTC | |
|
Re: My first MySQL database
by cfreak (Chaplain) on Feb 10, 2003 at 19:12 UTC | |
by sulfericacid (Deacon) on Feb 10, 2003 at 19:17 UTC | |
|
Re: My first MySQL database
by joefission (Monk) on Feb 11, 2003 at 04:55 UTC | |
|
Re: My first MySQL database
by sulfericacid (Deacon) on Feb 10, 2003 at 19:17 UTC |