Re: [OT-ish] Optional Extras.
| From: | Dave Mariner | Date: | Tue, 26 Jun 2001 10:52:12 +0000 |
| Subject: | Re: [OT-ish] Optional Extras. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55229@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "David Robley" <huntsman@www.nisu.flinders.edu.au>
To: "Dave Mariner" <dave@medlab-group.com>; <php-general@lists.php.net>
Sent: Tuesday, June 26, 2001 4:32 AM
Subject: Re: [PHP] [OT-ish] Optional Extras.
<SNIP>
> Why not have a table that contains carid and optionlink, where carid is
> the identifier for a unique entry of car model and optionlink is ditto
> for a particular option. So you have something like
>
> Table car
> carid (autoincrement unique key)
> carname
> ......
>
> Table options
> optid (autoincrement unique key)
> optdescription
>
> Table optlink
> carid
> optid
>
> Then you can do a select like
>
> select car.carid, options.description .... from car, options, optlink
> where car.carid = $whatever and car.carid = optlink.carid and
> (optlink.optid = x or optlink.optid = y ...)
>
> where you build the latter part from the list of options selected - maybe
> from a dropdown list that you can dynamically build from table options.
>
Yeah, this was the header-detail route that I was considering - the problem
is that the select above will come back with any car that has any of the
options specified. So if, for example, the options are "Manual","Electric
Windows", and for the sake of argument all automatic cars have e/w, the
query will return all cars. I know that's kind of artificial, but you get
what I'm driving at (if you'll excuse the pun).
=================================================
dave@medlab-group.com
www.medlab-group.com
"you didn't see what it was, you saw what you wanted to see".
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> "This is a sick bird," said Tom illegally.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>