Problem posting <select> multiple value

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 29, 2011   (RSS)

Re: [dennisoneil] Problem posting <select> multiple value

By Jason - December 29, 2011

Hi Dennis,

In CMS Builder, multi-select lists are stored as a string separated by tab (\t) characters. So what you need to do is to take your array and turn it into a tab separated string.

For example:

if (is_array($_REQUEST['territory'])) {
$territory = mysql_escape("\t".join("\t", @$_REQUEST['territory'])."\t");
}
else {
$territory = "";
}


You can then use the variable $territory in your INSERT statement.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Problem posting <select> multiple value

By dennisoneil - December 29, 2011

Worked perfectly. Thanks Jason.