Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#******************CODE********************* #!/usr/local/bin/perl -wT use strict; use CGI; use DBI; my $cgi = new CGI; my $fornavn = $cgi->param("fornavn"); my $efternavn = $cgi->param("efternavn"); my $cpr = $cgi->param("cpr"); my $adresse = $cgi->param("adresse"); my $zip = $cgi->param("zip"); my $city = $cgi->param("city"); my $tjenestested = $cgi->param("tjenestested"); my $dbh = DBI->connect("um","","","mysql") || die "Could not connect: $DBI::errstr\n"; my $sth = $dbh->prepare(INSERT into people (fornavn, efternavn, cpr, a +dresse, zip, city, tjenestested) values ($fornavn, $efternavn, $cpr, +$adresse, $zip, $city, $tjenestested)); $sth->execute(); $sth->finish(); $dbh->disconnect; print "Done\n";
Edit Masem 2001-10-15 - CODE tags, removed excess BR tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: dbi insert
by merlyn (Sage) on Oct 15, 2001 at 18:33 UTC | |
|
Re: dbi insert
by davorg (Chancellor) on Oct 15, 2001 at 18:47 UTC | |
|
Re: dbi insert
by MZSanford (Curate) on Oct 15, 2001 at 18:33 UTC | |
|
(jeffa) Re: dbi insert
by jeffa (Bishop) on Oct 16, 2001 at 01:58 UTC | |
by Anonymous Monk on Oct 17, 2001 at 12:37 UTC | |
by tommyw (Hermit) on Oct 17, 2001 at 12:45 UTC | |
by Anonymous Monk on Oct 17, 2001 at 15:48 UTC | |
by tommyw (Hermit) on Oct 17, 2001 at 16:03 UTC | |
by jeffa (Bishop) on Oct 17, 2001 at 19:51 UTC | |
|
Re: dbi insert
by ralphie (Friar) on Oct 15, 2001 at 21:51 UTC |