Hello everyone,

Please forgive in advance if this has already been posted...fairly new
to the list as have only been on it a week. At this point I only get the
digest, but just sent an email to subscribe to the full list.


I'm running apache 2.0x with mod_perl on a windows 2000 server.

I have a form page on the website where folks can enter a name and then
search a DB looking for that name and then give back the results on
another htm page.  I'm hoping this is a common thing to do.


Ok...the upshot is that using DBI:ODBC to access the access db works.
Also, I can use CGI.pm and know that the value from the form is getting
to the script.  

The problem lies in comparing the values from the form and the values
from the DB.  I keep getting no results.


Here's a snippet of the code:

#The CGI.pm module will take input from the form.
use CGI qw(:standard );
my $name=param("name");



#Connecting to DB
my $dbh = DBI->connect('DBI:ODBC:opal') or die "Oops! Couldn't
Connect".  DBI->errstr;
my $sth = $dbh->prepare ('SELECT ContactName FROM Contacts WHERE
ContactName=?')
        or die "Couldn't prepare the statement:" . $dbh->errstr;
my @row;
#DB now connected.  Run statements to find information.
$sth->execute(my $name);
while (@row = $sth->fetchrow_array){
print "@row\n";
}
if ($sth->rows == 0) {
    print "No names matched `$wholename'.\n\n";
    }

$sth->finish;
print "\n";


-->Would anybody have any ideas?  I've got the Programming the DBI book
as well as some others, but since I'm new to this, I may be leaving
something totally out.


Thanks in advance for your help and if this is a wrong post or offtopic,
please let me know.

thanks!



-- 
********************************************

Tony Bandy, MLS
[EMAIL PROTECTED]
Sys. Admin. OPAL
OHIONET
1500 West Lane Ave.
Columbus, OH  43221-3975
1-800-686-8975
(614) 486-2966 X19
(Emergency-->614-352-9409)
http://www.ohionet.org
http://cat.opal-libraries.org

IMPORTANT NOTICE:

This electronic message, including all attachments,
is intended only for the individual/company/representative
addressed above, and may contain CONFIDENTIAL, PRIVILEGED,
and/or TRADE SECRET INFORMATION.  If you are not the intended
recipient, this notification is to let you know that any use,
distribution, or copying of this electronic message, including
any attachments, is strictly prohibited.

If you feel you have received this email in error, please contact 
[EMAIL PROTECTED]

********************************************


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to