----- Original Message -----
From: "David Robley" <[EMAIL PROTECTED]>
To: "Dave Mariner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
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).
=================================================
[EMAIL PROTECTED]
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]