Hello! I am building an webapplication for retailers to register purchased products in PHP/MySQL. What I like to do now is to populate a dropdown menu in a form with the products the specific retailer sells. The retailer is assigned a value for each product that they are selling, and then the values are summed up and putten into the database in the colum Group. The group memberships can be determined by coverting the number in the Group column to binary and then check the specific position for a specific group in the string returned. Example: 5 is 101 in binary, this value is assigned to the Group column in the database. By checking if the first position is a 1 I'll determine if the retailer is selling Product 1. Noting that the second character is a 0 I thereby know they ar'nt selling Product 2. And since the last position is a 1 I also know they sell Product 3.
So for the retailer to register they've sold a Product 1, I want to populate a dropdownbox with only the prducts that retailer is selling.
I do understand I have to get the groupvalue (the binary value is set when loggin in using the $_SESSION['group']) loop it through to check wich products the retailer sells and in the same time populate the dropdownbox. I'm guessing a while loop inside the -tag, but how? The names (Product 1 and so on) are in a separate table with their values. Example:| 1 | "Product 1" | (the | are representing columns start/end). Any idea on how to do this? Or is it someway better to do this? A string in the table with the names wont work since the fields are limited to a number of chars and with many products that will be a problem.