Visually Comparing Rows on a MySQL table

shekki25shekki25 Midvale, UT
edited April 2011 in Internet & Media
Essentially what I'm looking for is a way to have a person check a box to "compare" each item they are interested in, then be able to load their choices on a single page so they can compare. I have the database set up with the info for each item, I just haven't been able to figure out how to make the script work. Any help would be awesome.


  • ButtersButters CA Icrontian
    edited April 2011
    It's been years since I've touched anything PHP, but in theory something like this should work.

    Rename or add empty brackets to your checkboxes so its an array: items[].

    Process your checkboxes to using something like this:
    [PHP]$items = implode(',', $_GET); [/PHP]
    Your SQL code needs the "in" operator to return multiple rows.
    SELECT * FROM itemstocomparetable WHERE items IN ($items)
Sign In or Register to comment.