I have a form with a number of checkboxes, which are generated from unique values in a MySQL table:
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<?php
$query5="SELECT distinct from_user from tracks WHERE uploaded_page='$this_path_short' ORDER BY from_user";
$result5=mysql_query($query5) or die(mysql_error());
while ($row = mysql_fetch_array($result5)) {
$from_user = $row['from_user'];
echo "<input type=\"checkbox\" name=\"from_user[]\" value=\"AND ".$from_user."\" checked=\"checked\">".$from_user."<br>";
}
?>
<input type="submit" name="submit" value="filter"><br>
I would then like to pass the array of 'from_user' values to another MySQL query on the page. I can get the values like this:
$names=implode(" ", $_POST['from_user']);
But I am not sure how to include this array in the following MySQL query:
$query1="SELECT * FROM tracks WHERE from_user IN **array goes here**)";