Hard to summarize this problem in the title, but I can try better here..
Alright, I have a multi-select form item, with 4 items. Now, in the code (using ajax, but using xajax class, which shouldnt matter). So here is the HTML code..
<select name="armortypes[]" multiple="yes" size="4">
<option value="cloth">Cloth</option>
<option value="leather">Leather</option>
<option value="chain">Chain</option>
<option value="plate">Plate</option>
</select>
Simple right? Well lets go onto the PHP code..
$counter = 0;
if(is_string($armortypes)) {
if(isset($equip_slot) || isset($class)) {
$query .= " AND (";
} else {
$query .= " (";
}
$data .= "(armortype='" . $armortypes . "') ";
} elseif(is_array($armortypes)) {
if(isset($equip_slot) || isset($class)) {
$query .= " AND (";
} else {
$query .= " (";
}
foreach($armortypes as $i) {
$query .= "armortype='" . $armortypes . "' ";
if(($counter + 1) == count($armortypes)) {
$query .= ")";
} else {
$query .= " OR ";
}
$counter++;
}
}
if I select one item, it still shows up as it being an array (it apparently passes the is_string test, but then when its printed out, says Array)... I'm not sure whats going on, the other 2 multi-select menus in the form work fine... this is the one that doesnt... am Id oing something wrong? Thanks for any help..