I've been poking around on these forums trying to find an answer to what is a fairly basic question, but not having any luck so far. So: I have a query from a database that pulls up a list of results, from which I need to select several items and then do something with them. Like so:
$result = mysql_query("SELECT * from table");
echo = "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"thepage.php\">";
while($results = mysql_fetch_array($result))
{
echo "<INPUT type=\"checkbox\" name=\"checkbox[]\"> <INPUT type=\"hidden\" name=\"thename[]\" value=\"$results[thename]>$results[thename]";
}
echo "<INPUT type=\"submit\" name=\"submit\" value=\"submit\"></form>"
On the next page, I try to do something with the results of the form. Specifically, I want to do something to each of the items that had a check next to them. For now, I'd be happy if it would just print out the thename associated with each checkbox, but now it just prints out Array.
foreach($_POST["checkbox"] as $key => $check)
{
echo "$check[thename]";
}
So what am I doing wrong? Any help would be appreciated...