multiple selection insert to DB

multiple selection insert to DB

am 29.12.2006 07:54:24 von Ace

Dear all

I have use DW making a PHP site and has set a multiple selection
field..But I don't know how to write the SQL statement to database like



If I choose 1 & 4, my database table will capture to array..I want the
DB can be caapture the 1,4, please teach me how to do this.(I know
array is a vars but i don't know how to write the statement)

BTW..If I would like recall this field to display. how to do it

Many thanks again

Ace

Re: multiple selection insert to DB

am 29.12.2006 09:03:29 von Shion

Ace wrote:
> Dear all
>
> I have use DW making a PHP site and has set a multiple selection
> field..But I don't know how to write the SQL statement to database like
>
>
>
> If I choose 1 & 4, my database table will capture to array..I want the
> DB can be caapture the 1,4, please teach me how to do this.(I know
> array is a vars but i don't know how to write the statement)

Much depends on how you want to store the data

One line, comma between entries:
$theline=implode(',',$_REQUEST['support']);

Do something for each entry:
for($i=0;$i $currentvalue=$_REQUEST['support'][$i];
/* do what you want with the $currentvalue */
}


> BTW..If I would like recall this field to display. how to do it

The above for loop.

--

//Aho