comparing logic
| From: | Ryan A | Date: | Sat, 10 May 2003 14:30:43 +0000 |
| Subject: | comparing logic | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147115@lists.php.net to get a copy of this message | ||
Hi,
querying the database with a condition (select * from packages where mb>=5
and price<=5 and os=linux) I am displaying the result in a table with a
checkbox at the side of each row which has its own unique $id_no
I want give the client/visitor a chance to be able to compare plans (max
upto 5 plans) hence building a query like this
select * from packages where
$id=$id_no1 and
$id=$id_no2 and
$id=$id_no3 and
$id=$id_no4 and
$id=$id_no5
but how do know if the client will want to compare just 2 plans or more or
all 5?
and lastly how can i make sure if he picks more than 5 comparisions it will
still only compare the first 5?
I know arrays are involved but although i love PHP I HATE arrays as i always
get confused with them even after going through arrays in the manual and in
my "php blackbook".
Kindly help.
Thanks,
-Ryan