Re: Is there sample application using mySQL+Perl+CGI+DBI ?
Rich Allen <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
an extremely simple example
#!/usr/bin/perl -w
use strict;
use CGI;
use DBI;
my $q = new CGI;
my $pathInfo = $q->path_info;
print $q->header;
if(!$pathInfo) {
print <<EOT;
<form name="form" method="POST" action="http://localhost/cgi-bin/
testcgi.pl/do">
<input type="textbox" name="i" size="3">Integer Value<br>
<input type="textbox" name="c" size="3">Char value<br>
<input type="submit" value="submit">
</form>
EOT
}
DoSQL() if($pathInfo =~ /do/);
print $q->end_html;
## -----------------------------------------------------
sub DoSQL {
my ( $dbh );
my $i = $q->param('i');
my $c = $q->param('c');
$dbh = DBI->connect( "dbi:mysql:database=test;host=localhost",
'user', 'pass') or die "cant connect";
$dbh->do("insert into testac values($i, '$c')");
$dbh->disconnect or warn "Disconnection failed: $DBI::errstr\n";
}
__END__
On Feb 21, 2006, at 8:04 AM, [email protected] wrote:
> Does anyone know where I can download a sample working mySQL web
> application, such as "Address Book", that is using
> mySQL in Perl (not PHP), hopefully with CGI.pm and DBI? I'd like to
> use it
> as a test application to prove mySQL and Perl
> environment is working and maybe just modify this simple
> application to do
> what I want.
>
> I'm installing the mySQL+Perl+CGI programming environment in
> Solaris 10
> server to develop a web application to replace
> the Microsoft Excel spreadsheet, which allows multiple people
> access/modify the data at the same time, including import and
> export Excel to/from mysql database. (do you know any existing
> application like this?)
>
> Any help would be really appreciated and thank you in advanced!
>
> gordon
Rich Allen
A kidney transplant saved my life, plese consider being an organ donor.
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/[email protected]