Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2011
    Thanked 1 Time in 1 Post

    Script for matching products together - advice needed

    Hi guys

    I'm currently building up a projector lamps shop. I need to get all of the world's existing projectors (makes & models), all of the available lamps for them and then tell which projector matches what lamps.

    My idea was to go to a similar website and grab all the makes & models from it's source, which would give me list like that:

    <option  value="CP 2000X (4500W) (CDXL-45)-vprf.html">CP 2000X (4500W) (CDXL-45)
    <option  value="CP 2000X (6000W) (CDXL-60)-vprf.html">CP 2000X (6000W) (CDXL-60)
    <option  value="CP S1024-vprf.html">CP S1024
    ... etc
    Then replace html tags with MySQL syntax, so that everything can be injected into database straight away. Do the same then with lamps, and finally create a MySQL table "compatibility" which would contain 2 fields - projector_id and lamp_id - which would then pair the lamp with the compatible projector.

    Now my question - is there any easier/smarter way to do it? Any advice on any part would be greatly appreciated.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,325 Times in 4,291 Posts
    Well, that's the correct DB design. So I'd be very inclined to say "yes," you have it right.

    I don't know how you will determine that lamps are compatible with what projectors, but if you have that part worked out to your satisfaction then I think there's nothing more to say.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts