Select Value Equal to Array
I'm using Dreamweaver CS5 with PHP and a MySQL database. I'm trying to read from an array (states[]) in the database that list all selected states a contractor might work in, i.e. WA,ID,OR... my insert record is savaing my array with the state abriviations with a coma in between with no space, which is fine with me. My code for the insert record is:
if (isset($_POST['states'])) {
$_POST['states'] = implode(',', $_POST['states']);
} else {
$_POST['states'] = null;
}
To test what my result needs to be, I have tried to hard code the Select Value Equal To box in the Dynamic List/Menu to WA which selects WA (Washington) fine. The Allow Multiple Selections checkbox is selected for this list/menu. When I try to hard code more than one state like WA,ID, nothing is selected. I have also tried to select WA ID and WAID. What is the proper format of the Select Value Equal To in order to select multiple items.
Once the hardcoding is figured out I was going to try to figure out how to loop through in PHP and have it dynamically select from the record and echo (or otherwise print) in the proper format so multiple states from the array would be selected. However, if someone out there has a sample, that would be great.
Thanks in advance for your help!
Darren
