I have a form that is built off of a query from Table1 which has about 20 records:
$result = mysql_query("SELECT showId FROM Table1") or die('MySQL said '.mysql_error());
while ($row = mysql_fetch_array($result)) {
$thisShowId = $row[0];
echo "<input type=\"checkbox\" name=\"$thisShowId\" value=\"Yes\">";
}
When this is posted, I then need to see which ones were checked that match entries in Table2 which has some portion of the same records as Table1:
$result = mysql_query("SELECT showId FROM Table2") or die('MySQL said '.mysql_error());
while ($row = mysql_fetch_array($result)) {
$thatShowId= $row[0];
$showMatch= $_POST['$thatShowId'];
if ($showMatch == "Yes") { echo "Match"; }
}
I seem to get every option in the form back as if they were all checked, or nothing back as if nothing was checked.
Is calling up the POST variable in a WHILE statement based on query results incorrect?
Any help is appreciated.