Hi,
I am not a programmer, work with php from time to time and mostly to do easy stuff, so my knowledge is very basic.
I am trying to get the values of an array, coming from a select with multiple options, to use them in the "where" part of mysql queries. After looking around I don't know how to do this. Here i paste my code:
<HTML>
<select name="enquesta[]" size="8" multiple>
<option value="All" SELECTED>All</option>
<option value="EB1">Eurobarometer 1</option>
<option value="EB2">Eurobarometer 2</option>
<option value="EB3">Eurobarometer 3</option>
<option value="EB4">Eurobarometer 4</option>
<option value="EB5">Eurobarometer 5</option>
<option value="EB6">Eurobarometer 6</option>
<option value="EB7">Eurobarometer 7</option>
<option value="EB8">Eurobarometer 8</option>
<option value="EB9">Eurobarometer 9</option>
<option value="EB10">Eurobarometer 10</option>
...
<option value="EB64">Eurobarometer 64</option>
</select>
</HTML>
and the php one:
<PHP>
$enquesta=$_POST['enquesta'];
$enq_explo = explode(', ', $_POST['enquesta']);
echo count($enquesta)."<br />";
echo $enq_explo[0];
if (count($enquesta)==1 & $enq_explo[0]=="All")
{$str_enquesta=="";
}
if (count($enquesta)==1 & $enq_explo[0]!="All")
{$str_enquesta=="AND q.questionnaireid LIKE '$enq_explo[0]'";
}
echo "<br>".$str_enquesta;
</PHP>
I have to continue the php code to recover the options selected by the user when they are more than one. But even with only option I cannot succed; with this code I only get the output "Array".
Any help will be welcomed. Thanks in advance.