This is done via Mysql and some php.
I have a form which have two fields, width and height. Both are check boxes with numbers 15-75 listed as rows in my database. I'm populating the check boxes from the database..so the user can choose any combinations of widths/heights.
Now inserting into my database is all numbers they chose with a "," separating them. What I want to accomplish is to perform a search query against results from a separate form (in this form the user will choose a width and a height) to end in eventually echoing out one, or several, combinations that came from that query.
I figured using 'IN' in my query would be right but I guess the commas interfere.
Currently I'm trying:
SELECT *
from `contractors_parameters`
join `contractors_width` `cw`
join `contractors_height` `ch`
join `Windows_last_submissions` `wls`
where `contractors_parameters`.`width` IN `wls`.`width`
and `contractors_parameters`.`height` IN `wls`.`height`
and `contractors_parameters`.`material` IN `wls`.`chosenmaterial`
and `contractors_parameters`.`type` = `wls`.`type`
and `contractors_parameters`.`price` <= `wls`.`maximumbid`
ORDER BY `contractors_parameters`.`company` ASC
Table 'contractors_parameters' is the table that holds the information which may or may not include several different widths/heights separated by commas. Table 'Windows_last_submissions' is the very last submission in which a user chose a width and a height. Thank you for your help. Using 'IN' results in a syntax error - perhaps a way of allowing the query to disregard the commas somehow?