Reply to Re: any way to avoid millions of 'if' args??? please.

Your name:

Reply:


Posted by Stefan Rybacki on 11/12/99 11:21

Geoff Berrow wrote:
> I noticed that Message-ID: <W5ydndoO85Kf20XfRVn-1g@is.co.za> from Peter
> Butler contained the following:
>
>
>>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.
>
>
> Well If you are basing a query on 14 variables then, as you've worked
> out, there are a lot of combinations. Most people here will be thinking
> that you can do this with the query itself but we need to know the exact
> nature of the problem.

Thats what I stated before. An example of what he is trying to do would be nice. ;)

>
> Lets take a simple case. Say I sell shoes and I have three fields,
> size, colour and type.
>
> After sanitizing the input from the form (using
> mysql_real_escape_string() ) we could end up with three variables $size,
> $colour and $type
>
> The query would then be something like
>
> $sql= "SELECT * FROM `shoes` WHERE size='$size' AND colour='$colour' AND
> type='$type'";

Yes or seperated with OR, whatever without an example of what he really wants it's just
guessing.

So Peter please show us what you're trying to do. Thanks.

Regards
Stefan

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация