I don't see how this is weighted.
The count(car_id) and group_by should give a score for each car_id.
I neglected to use count(car_id) as score and to add order by score desc
though.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
I don't see how this is weighted.
I would suggest doing it the easy way and treating the options as
keywords and just putting them all in a text field with a fulltext
index. this will give you the weighting you want and it will be a lot
easier to deal with, but you will have to watch out for
How about solving both problems at once? :-)
Yes, go with the N:N (the technical term for that car_option table)
relation, *AND* give yourself a weighted search engine to boot!
create table car (car_id auto_increment...);
create table option (option_id auto_increment...);
create table
off the top of my head, you could try using a
lookup table to define the extra options...
ford_spec table:
id desc
--- ---
1 air conditioning
2 whatever
ford_cars table:
car extra1 extra2
-- --- -
'contour' 1
- Original Message -
From: ..s.c.o.t.t.. [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Tuesday, June 26, 2001 7:35 AM
Subject: RE: [PHP] [OT-ish] Optional Extras.
off the top of my head, you could try using a
lookup table to define the extra options...
ford_spec table:
id
- 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
solution was fast and simple and efficient.
i agree with the second point, that having
hundreds or thousands of options would definately
degrade performance.
-Original Message-
From: Dave Mariner [mailto:[EMAIL PROTECTED]]
Subject: Re: [PHP] [OT-ish] Optional Extras.
The problem
- Original Message -
From: Rich Cavanaugh [EMAIL PROTECTED]
To: Dave Mariner [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, June 26, 2001 1:53 AM
Subject: RE: [PHP] [OT-ish] Optional Extras.
Dave,
I did something similar and I came up with an interesting way of
approaching
Dave,
I did something similar and I came up with an interesting way of
approaching it:
Assign IDs to each car (obviously).
Assign an ID to each option.
Match up your car IDs and option IDs in a seperate table.
Here's some table defs:
create table cars (
carid int
9 matches
Mail list logo