Product Finder
Looking for a hand cleaner that will meet your specific needs, but
aren't sure which of our products is right for you? Search through
the Dab-A-Do database to find which of our products meet your
requirements.
In the following boxes, choose the features that you are looking for in a hand cleaner.
Click the Get Results button when finished.
<%
$base = "%";
$grit = "%";
$consistency = "%";
if ($Request->Form('base') ne "any") {
$base = $Request->Form('base');
}
if ($Request->Form('grit') ne "any") {
$grit = $Request->Form('grit');
}
if ($Request->Form('consistency') ne "any") {
$consistency = $Request->Form('consistency');
}
%>
<%
# DBI is perl module used to connect to the database
use DBI;
# hostname or ip of server
# (for local testing, localhost should work)
$config{'dbServer'} = "localhost";
# username and password to log onto db server
$config{'dbUser'} = "dabado";
$config{'dbPass'} = "dabado";
# name of database
$config{'dbName'} = "dabado";
# MySQL driver (shouldn't need to change)
$config{'dataSource'} =
"DBI:mysql:$config{'dbName'}:$config{'dbServer'}";
my $dbh = DBI->connect($config{'dataSource'},$config{'dbUser'},
$config{'dbPass'}) or
die "Can't connect to $config{'dataSource'}In the following boxes, choose the features that you are looking for in a hand cleaner.
Click the Get Results button when finished.
$DBI::errstr"; #prepare and execute SQL statement $sqlstatement="SELECT StockNum, ProductName, ProductDescription, Consistency, Grit, Fragrance, Base, Size, NumPerCase, ShippingLbs, Picture FROM handcleaners WHERE Grit LIKE '%$grit%' AND Base LIKE '$base' AND Consistency LIKE '$consistency' ORDER BY StockNum"; $sth = $dbh->prepare($sqlstatement); $sth->execute || die "Could not execute SQL statement ... maybe invalid?"; #output database results print "
| Stock No. | \n"; print "Product Description | \n"; print "|||
| Fragrance | \n"; print "Size | \n"; print "# Per Case | \n"; print "||
| ";
if ($picture eq "nopic.gif") {
print "Picture Not Available"; }
else {
print " | \n";
print " $stockNum | \n"; print "$description | \n"; print "||
| $fragrance | \n"; print "$size | \n"; print "$numPerCase | \n"; print "||
"; } $dbh->disconnect(); %>
