in reply to Re: variable substitution using Like in DBI
in thread variable substitution using Like in DBI

More specifically,
my $input = param('input'); #or however you're getting it chomp $input; #any other processing to deal with unwanted characters my $sth = $dbh->prepare("SELECT someFields FROM mytable WHERE myqualif +ier LIKE ?"); $sth->execute("$input*");

Replies are listed 'Best First'.
Re: Re: Re: variable substitution using Like in DBI
by Grygonos (Chaplain) on Sep 11, 2003 at 19:42 UTC

    That is exactly what I tried but to no avail. It doesn't return any results. I'm assuming (note: assuming) that its a qwirk with Access or ODBC that I'm just not accounting for. Anymore ideas are VERY much welcome.. thanks guys.

    edit FYI my query will run correctly with that syntax but does not produce the same results as running it interactively. I get no results in script, and the appropriate number in the interactive

      Are you checking $sth->err?