"Christopher J. Crane" wrote:
>
> Below is a snippet of my code with your suggestion on using CLIKE. The
> problem is that now this SQL statement:
> "SELECT ProductLineName,PartNumber FROM SiliconBridgeRectifers WHERE
> ProductLineName CLIKE '$form{'ProductLine'}%'"
>
> returns everything in the database. Am I doing something wrong here? In
> fact, even if $form{'ProductLine'} is NULL it returns everything in the
> database.
What is the value of $form{'ProductLine'}? If it is an empty string
then searching for a CLIKE on "empty string + %" would find everything
in the database (literally you are searching for nothing followed by
anything which is one way of saying "everything"). If
$form{'ProductLine'} has some other value, then that select statement
should work. My guess is that there is something unexpected with your
data or user input since your code looks ok.
--
Jeff