Reply to Anoying problem with multi $var combinations Pse help..

Your name:

Reply:


Posted by Peter Butler on 11/14/83 11:21

OK, lets see...

I have 10 text boxes to enter keywords into a form page (The master search
page)

These boxes are either set or not set when passed to the result page as set
or unset variables.

Depending on which variables have been set, the set variables are used to
formulate the query.

I have got this to work perfectly... but I am convinced that I'm using the
dinosour method. ie.:

if ($a==a && $b==a && $c==a && $d==a && $e==a && $f==a && $g==a && $h==a &&
$i==a && $j==a)
{ do thing AA}
elseif ($a!=a && $b==a && $c==a && $d==a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing BB}
elseif ($a==a && $b!=a && $c==a && $d==a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing CC}
elseif ($a==a && $b==a && $c!=a && $d==a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing DD}
elseif ($a==a && $b==a && $c==a && $d!=a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing EE}
elseif ($a==a && $b==a && $c==a && $d==a && $e!=a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing FF}
elseif ($a==a && $b==a && $c==a && $d==a && $e==a && $f!=a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing GG}
elseif ($a==a && $b==a && $c==a && $d==a && $e==a && $f==a && $g!=a && $h==a
&& $i==a && $j==a)
{ do thing HH}
elseif ($a==a && $b==a && $c==a && $d==a && $e==a && $f==a && $g==a && $h!=a
&& $i==a && $j==a)
{ do thing II}
elseif ($a==a && $b==a && $c==a && $d==a && $e==a && $f==a && $g==a && $h==a
&& $i!=a && $j==a)
{ do thing JJ}
elseif ($a==a && $b==a && $c==a && $d==a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j!=a)
{ do thing KK}

/* then different combos of two's */
elseif ($a!=a && $b!=a && $c==a && $d==a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing BB}
elseif ($a!=a && $b==a && $c!=a && $d==a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing BB}
elseif ($a!=a && $b==a && $c==a && $d!=a && $e==a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing BB}
elseif ($a!=a && $b==a && $c==a && $d==a && $e!=a && $f==a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing BB}
elseif ($a!=a && $b==a && $c==a && $d==a && $e==a && $f!=a && $g==a && $h==a
&& $i==a && $j==a)
{ do thing BB}
etc, etc, etc...........

/* then different combos of threes */
elseif ($a!=a && $b!=a && $c!=a...
{do thing wada-wada...
elseif ($a!=a && $b!=a && $c==a...
{do thing wada-wada...
elseif ($a!=a && $b!=a && $c==a...
{do thing wada-wada...
etc, etc, etc...........

/* then different combos of fours */
elseif ($.......................................................
elseif ($.......................................................
elseif ($.......................................................
etc, etc, etc...........

/* then different combos of fives */
elseif ($.......................................................
elseif ($.......................................................
elseif ($.......................................................
etc, etc, etc...........

/* then different combos of sixes */
elseif ($.......................................................
elseif ($.......................................................
elseif ($.......................................................
etc, etc, etc...........

/* then different combos of sevens */
elseif ($.......................................................
elseif ($.......................................................
elseif ($.......................................................
etc, etc, etc...........

/* then different combos of eights */
/* then different combos of nines */

/* until... three thousand six hundred and forty-nine lines of code later
we get to make*/
elseif ($a!=a && $b!=a && $c!=a && $d!=a && $e!=a && $f!=a && $g!=a && $h!=a
&& $i!=a && $j!=a)
{ do thing XXXXXXX}

- OK... For those eagle eyes out there... I actually have 14 different
fields in which to set variables... two pairs of which are grouped together
as max/min values,
but I do really have 3649 lines of stuff that is slowing down my DUAL PIII
500 on saves.

This can't be the right way... really???

[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

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