Re: set array
| From: | David Robley | Date: | Tue, 26 Nov 2013 03:21:11 +0000 |
| Subject: | Re: set array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322505@lists.php.net to get a copy of this message | ||
John Taylor-Johnston wrote:
> I have a SET field in MYSQL.
> '1. Type One','2. Type Two','3. Type Three'
>
> The user can multi-select
> <select name="DPRtype[]" multiple>
> <option value="1. Type One">
> <option value="2. Type Two">
> <option value="3. Type Three">
> </select>
>
> I just dont know how to express $_POST[DPRtype] to be able to build the
> $SQL to express the separate possibilities.
>
> $sql = "UPDATE
>
taylorjo.CRTP_CGA
> SET
> DPRtype = '$_POST[DPRtype]'
> ";
>
>
> Thanks. Not a newbie. I should know how to do this. I just don't code
> every day.
Use implode() to create a comma separated string for insertion into your
table
--
Cheers
David Robley
Why are Chinese fortune cookies written in English?