Posted by Tony on 07/19/05 00:36
Peter Butler wrote:
> Geoff Berrow <blthecat@ckdog.co.uk> wrote in message
>
>> I still don't get what you are trying to do but I'd agree there must
>> be an easier way.
>
> I am trying to get php to dynamically create the correct combination
> of arguments to formulate a complex Mysql query, based on which
> combination of $vars have been passed to the result.php script.
>
> Instead of physically listing every single possible combination of 14
> different variables...
Can you build the query in parts?
Something like:
$query = "SELECT * FROM table WHERE ";
if ($a=='a') {
$query .= "a='$a' ";
}
if ($b=='a') {
$query = "AND b='$b'"
}
(I know it's a bad example - but you should get the basic idea)
--
Tony Garcia
Web Right! Development
Riverside, CA
www.WebRightDevelopment.com
Navigation:
[Reply to this message]
|