Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    England =)
    Posts
    523
    Thanks
    26
    Thanked 0 Times in 0 Posts

    advice on best method to use

    hi guys. im looking for some advice on the best way to do the following (new baby and lack of sleep seem to have seriously hampered my IQ! )

    i have a form (safety_pack.php) & associated sql table (safety_packs)

    on this form i need users to pick from a list of safety items, im using checkboxes for this (the items are in a sql table called safety_pack_items)

    im trying to figure out the best way to link this up. i know i could cycle though the items (about 100) and use ajax to create/delete items in another table (maybe safety_pack_item_selections) that would just have the id of the item and the id of the safety pack. but all those lookups when the page loads could slow things down a bit. the toggling bit would be instant and easy enough to do in ajax. im more concerned with 100+ little lookups on page loading.

    i could just cop out and create all the items onto the safety_pack table as fields but then adding new items or removing them would be a pain and im trying to build this in a modular fashion with a possibility of reselling to small building companies.

    edit: i guess i could create a text field on the safety_packs table and just add/remove the id to it? that might be quicker and hide that field on the form.

    sorry if this doesnt make sense. im fuelled on lots of coffee and seriously lacking sleep!
    Last edited by Inigoesdr; 09-14-2011 at 08:28 PM. Reason: Set to resolved
    "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    England =)
    Posts
    523
    Thanks
    26
    Thanked 0 Times in 0 Posts
    ok, the idea in my edit works very well.

    all sorted!
    "They hired me for my motivational skills. Everyone at work says they have to work much harder when I`m around" Homer J Simpson


  •  

    Posting Permissions

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