Note that there are some explanatory texts on larger screens.

plurals
  1. POMapping products with similar names
    primarykey
    data
    text
    <p>I am trying to find a good solution to accomplish the following:</p> <p>I have a table which includes the name of various products, such as:<br> "Tide - Original Scent".<br> In addition, I also have the amount in there for e.g. 50 fl oz.</p> <p>The problem I have right now is, that the product not only comes in containers of 50 fl oz but also in different sizes such as 75 fl oz and 100 fl oz. For each of these I have new rows in the product table: </p> <pre><code>id| productName | amount | unit 1 |"Tide - Original Scent" | 50 | "fl oz" 2 |"Tide - Original Scent" | 75 | "fl oz" 3 |"Tide - Original Scent" | 100 | "fl oz" </code></pre> <p>Now I have a web interface to perform a search on this table and whenever I search for "tide" I get all three rows - which is supposed to be like that of course. However I would like a different behavior and this is where I need your help:</p> <p>Instead of returning all three rows I would like one row only. I would then need to be able to process it in php so that if the user clicks on "Tide - Original Scent" that the user is then prompted to select the size.</p> <p>To add even more complexity to the task: I also have products in the same table named:<br> "Tide - Mountain Spring".<br> In this case, it would be great to have some relations set up so I know that "Tide - Original Scent" is linked with "Tide - Mountain Spring". Within php I would then like to not only give the user the choice of selecting the size but also the (in this case) scent.</p> <p>What would your recommendation be on how I can accomplish this (not the php part)?<br> How would your database look like?<br> Do I need to create a table where I map these products? How would this look like if you would create this :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload