Originally posted by kevinsequeira
right u dont need to use temp variables. if u run into problems, debug by printing out your insert query and see what its actually doing
reg
kevin
That did what mine did, but was much cleaner, I like it. This is what was printed out to my screen:
INSERT into housingFour values ('Adams Morgan', 'Wanted to Rent', 'parking', 'this is your entry dog!')
INSERT into housingFour values ('Adams Morgan', 'Wanted to Rent', 'studio', 'this is your entry dog!')
INSERT into housingFour values ('Adams Morgan', 'Wanted to Rent', 'dishwasher', 'this is your entry dog!')
The query was successfully executed!
What ended up happening was that each time through the foreach loop, everything was overwritten, which is ok for the items that the user only selects one for, but not for the third value, which should have multiple items.
I wanted the third entry to have all the values: "parking", "studio", and "dishwasher" instead, it only had "dishwasher" How do I get it to have all 3 - or more?
Also, perhaps I can just skip over that, because what I'll do eventually is have these things displayed in a table, and I think I want one 'amenity' per column. That way, when searching, the user can search to see if there are records that have all her selected "amenities." (When I say amenities, I am referring to the third value that had 'dishwasher' 'parking' and 'studio'.)
In such a case, do I need all the amenities in separate scalars, or, can they still be part of the same array, fill up a cell and still be searchable?
so one or two questions:
how to get all the values selected from the checkboxes (as that is how the amenities are set up) into one cell per record, and still be searchable,
AND/OR
how to get the 20+ elements from the amenities array into their own individual temp scalar like $dishwasher, $parking etc, in order to allow them to have their own column which will make the record more searchable...I think.
Thanks in advance. Apologies for taking so long to get to a clear question.