Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$dbh = DBI->connect("DBI:ODBC:$db",$user, $pass, {RaiseError => 1}); my $sql_s="SELECT * FROM main WHERE record_number='$db_number'"; $sth = $dbh->prepare($sql_s); $sth->execute() || die $sth->errstr; while ($pointer = $sth->fetchrow_hashref) { $record_id = $pointer->{'record_id'};$record_id=~s/\s//g; if($record_id){ print "<br><font color=red>Record Found: $record_id </font><br>"; }else{print "<br><font color=red>No Record Found </font><br>";} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl and SQL issue.
by derby (Abbot) on Jun 28, 2007 at 12:43 UTC | |
by Anonymous Monk on Jun 28, 2007 at 13:21 UTC | |
|
Re: Perl and SQL issue.
by Corion (Patriarch) on Jun 28, 2007 at 12:47 UTC |