On Fri, 17 Oct 2003, Wade Preston Shearer wrote:
> BUT, what if i want the user to be able to select as many or as few
> options as they want? meaning that they can select "name + color" or
> "name + number + fruit" or any combination?
Are you using an SQL database? If so, it should be pretty simple to just
make your SQL query based on the items they select [look into doing
something like join($array, " and ") ...] so that the database will only
return the matching rows.
> am i making this more complicated than i need to? am i going about this
> entirely wrong?
Even if you're not using an SQL database, it's still way more complicated
than it needs to be. Stick all the search parameters into a single array
(there's some way to name your HTML form so that it comes POSTed as an
array), then put a "foreach" loop walking through each value in the array,
and checking the variable that way.
[Programming hint: any time you have many lines of nearly identical if{}
statements (or anything nearly identical) there's almost always always a
better way of doing it.]
Sorry this is kind of vague, but it's true, if you gave us some real data
we might be able to be a bit more helpful.
~ross
p.s. I think you mean "pseudocode". ;-)
--
This sentence would be seven words long if it were six words shorter.
_______________________________________________
newbies mailing list
[EMAIL PROTECTED]
http://phantom.byu.edu/cgi-bin/mailman/listinfo/newbies