Arrays in single row/column?
Posted: Tue Apr 01, 2003 1:03 am
I have been struggling with a design issue and I think I have come to the conclusion that you "can't do that with PHP/MySQL". Please help me confirm.
I have a site with 100+ products and would like to allow a salesperson to log in and be able to choose their region and then choose a set of products that they sell in that region from the entire product table, inserting their "set" (say 14 out of 125) into a row defined by their region/name/set.
I assumed for a while that I could load the whole product table of numbers/names into a select list form, have them choose their region/set and then have PHP insert that set (just ID numbers) into a field as a simple text list separated by spaces. Then I would be able to pull that field and use it as an array to then display their set in the future. HA.
First of all, I can't get the field to accept my insert record statement (it just puts the text "Array" in the field).
mysql_fetch_array only seems to work on multiple row query results. So, I may not be able to use that field even if it were populated.
Do I hear a round of "dohs"?
Any pointers would be appreciated. Other options for doing the same thing?
thanks
I have a site with 100+ products and would like to allow a salesperson to log in and be able to choose their region and then choose a set of products that they sell in that region from the entire product table, inserting their "set" (say 14 out of 125) into a row defined by their region/name/set.
I assumed for a while that I could load the whole product table of numbers/names into a select list form, have them choose their region/set and then have PHP insert that set (just ID numbers) into a field as a simple text list separated by spaces. Then I would be able to pull that field and use it as an array to then display their set in the future. HA.
First of all, I can't get the field to accept my insert record statement (it just puts the text "Array" in the field).
mysql_fetch_array only seems to work on multiple row query results. So, I may not be able to use that field even if it were populated.
Do I hear a round of "dohs"?
Any pointers would be appreciated. Other options for doing the same thing?
thanks