adding multiple values from a form into a set

I have a form which enters all of the information from a business into the data base. One of the data rows is a set type, with possible values, of:
Live Enertainment, Waterfront View, Valet Parking. The form looks like this:

Restaurant Features:
Live Entertainment
Outdoor Patio
Valet Parking
Waterfront View

with of course additional information preceding and after it. I am not sure what the code should look like in my record addtion script to enable this to work properly.

If anyone can help it would be appreciated.

Brian W

if you are using the SET data type you should check out explode () - - and remember you are working with a 2 dimensional table (outside array is $_POST/$_GET and the inside array is restFeature[]) so make sure your code handles it.

Ok, I understand the explode function now, however, I am not sure where to put it? Would I put it into the insert statement?

Brian W

No. Explode is to be used in the PHP outside of the INSERT statement.


if submit button pushed
    get data from form and move into working variables
        move singular pieces
        explode the array from the form into a working variable
    insert data into Database
    display data has been inserted
    display form
Sponsor our Newsletter | Privacy Policy | Terms of Service