|
Posted by rich on 10/13/38 11:31
In article <3LedndYzjMDWf-3enZ2dnUVZ_tSdnZ2d@rogers.com>, shawn says...
>
>Hi I have a situation where the user will choose a subset of a list of items
>and display by submitting request. For example I have apple, orange and
>pear. A user may select apple and pear, or orange and pear or all etc.
>
>How to I contruct the WHERE clause?
>
>SELECT fruit_name, price FROM fruit_table WHERE fruit_name = .....
>
>Can you help?
>
>Thanks!
>
>Shawn
>
>
You could use a form to get the user selection, such as...
$fruit_name = $_GET['fruit_name'],
Then build a query with that similar to..
$query = "select * from fruit_table where \'$fruit_name\'";
Rich
--
Newsguy -- http://newsguy.com
[Back to original message]
|