commit 1c31c3cc4cd40ef00d33239a632a98e5ff76eede
parent 11f4ba566f2f73bfba6b842c271b204e7d376130
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Wed, 22 Oct 2014 22:17:36 -0600
search: also search for the part number
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/search.pl b/search.pl
@@ -40,8 +40,9 @@ while ($request->Accept() >= 0) {
read(STDIN, my $input, $ENV{CONTENT_LENGTH});
(undef, $input) = split("=", $input);
- my $query = "select part_num from products where title like ?";
- my $products = $dbh->selectcol_arrayref($query, undef, "%$input%");
+ my $query = "select part_num from products where title like ? or part_num like ?";
+ my $products = $dbh->selectcol_arrayref($query, undef,
+ "%$input%", "%$input%");
my $vars = {
query => "\"$input\"",