ginda has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); use vars qw($Query $dbh $sth $Value); $Query = new CGI( ); use DBI; $dbh = DBI->connect("DBI:mysql:exelstock") or die "Cannot connect: " . $DBI::errstr; $Value = $Query->param('Value'); $sth = $dbh->prepare("SELECT * FROM walstock WHERE name='$Value'"); $dbh->execute($sth); print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<BODY>\n"; while (@results = $sth->fetchrow_array) { print "@row\n"; } $sth = $dbh->finish(); $dbh->disconnect(); print "</BODY>\n"; print "</HTML>\n";
20050316 Edit by ysth: code tags
20050318 Edit by Corion: Changed title from 'Help im new so so late for uni project!!'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with uni project: DBI errors in CGI script
by dragonchild (Archbishop) on Mar 16, 2005 at 14:07 UTC | |
|
Re: Help with uni project: DBI errors in CGI script
by RazorbladeBidet (Friar) on Mar 16, 2005 at 14:09 UTC | |
| |
|
Re: Help with uni project: DBI errors in CGI script
by jZed (Prior) on Mar 16, 2005 at 20:29 UTC | |
by Anonymous Monk on Mar 16, 2005 at 21:27 UTC | |
by jZed (Prior) on Mar 16, 2005 at 21:31 UTC | |
by ginda (Initiate) on Mar 16, 2005 at 22:13 UTC |