RE: [PHP] Building a query on multiple variables, how to test for which variable

2002-08-29 Thread @ Edwin
Does this fit your idea of a "more elegant solution"? This is just an enhanced and tested version of the one I posted earlier (somehow I had time and was curious about it). ?php if (isset($_POST['var'])){ // if POSTed // initial query // make sure "WHERE" not included when none is

Re: [PHP] Building a query on multiple variables, how to test for which variable

2002-08-28 Thread @ Edwin
There must be a better way how to do it but this is what I would do: (Not tested--just the "idea"...) Instead of $var1, $var2... I'd use an array for the drop downs thus, $var[] $var[] $var[] $var[] Then, check if any is set, then... anyway, this is how it goes: // from here

RE: [PHP] Building a query on multiple variables, how to test for which variable A SOLUTION

2002-08-28 Thread Jay Blanchard
Todd came in with a good suggestion which I had started towards, so this is what I have arrived at for the moment. I will be looking to make this more elegant soon, but since they are screaming for the report now this is what I did; ?php if($usoc1 "--- Select ---"){

Re: [PHP] Building a query on multiple variables, how to test for which variable A SOLUTION

2002-08-28 Thread Joseph W. Goff
I have done this two different ways. The first involves a function that creates a dropdown from the database. What is special about this function is that I assign it's own condition as part of the value for that option. Take this sql statement: select distinct column_name from the_table and it