Generating Query from Multiple select box?

From: Date: Mon, 09 Oct 2000 20:29:10 +0000
Subject: Generating Query from Multiple select box?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19237@lists.php.net to get a copy of this message
Hello, I have a select box that has 8 available selections. on the page that receives the selections it has a query string that looks like this SELECT count(search_table.word) as score, search_table.qid,data.ad,data.startdate,data.ID FROM search_table,data WHERE data.ID = search_table.qid AND data.mainclass = '$mainclass' AND search_table.word IN($querywords) GROUP BY search_table.qid ORDER BY score DESC LIMIT $start,$stop The Select box is named mainclass witch is coming as an array. Does any one have any Idea how to turn that query into a query that looks like this. SELECT count(search_table.word) as score, search_table.qid,data.ad,data.startdate,data.ID FROM search_table,data WHERE data.ID = search_table.qid AND [the select box data being placed in this format here] data.mainclass = '$mainclass' or data.mainclass = '$mainclass' data.mainclass = '$mainclass' or data.mainclass = '$mainclass' [the select box data being placed in this format here] AND search_table.word IN($querywords) GROUP BY search_table.qid ORDER BY score DESC LIMIT $start,$stop I have tried several different ways to accomplish this and none have been successful. Any help would be greatly appreciated. Thank you Brian Paulson Sr. Web Developer 1-800-279-6397 X207 bpaulson@chieftain.com *************************

« previous php.general (#19237) next »