they print fine... just not being passed for some reason... it's too weird..
Here's the ALL the (related) code:
<form action="thisfile.php" method="post">
<dl>
<dt><label for="stations">Choose station:</label></dt>
<dd><select id="stations" class="asmSelect" multiple="multiple" name="stations[]" title="Click to Select a Station">
<?php
$result =mysql_query( "SELECT s.cl, s.sid FROM s WHERE s.sid NOT IN ( SELECT t.sid FROM t WHERE t.song=$id) ORDER BY cl ");
if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); }
while($row = mysql_fetch_array($result))
{
$cl = $row["cl"];
$sID = $row["sid"];
echo "<option value=\"$sID\">$cl</option>";
}
?>
</select></dd>
</dl>
<input type="hidden" name="song" id="song" value="<?php echo $id ?>">
<input type="submit" name="submit" value="Submit" class="btn">
</form>
</div>
<?php
if ($_POST["submit"])
{
$songID = $_POST['song'];
$insertStatement = 'INSERT INTO status (song, sid) VALUES ';
foreach($_POST['stations'] as $stationID) {
$insertStatement .= "($songID, $stationID), ";
}
$insertStatement = rtrim($insertStatement, ", ");
echo $insertStatement;
$insertThem = mysql_query($insertStatement);
if (!$insertThem) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); }
}
?>
like I said.. it'll post if I remove the
NOT IN ( SELECT T.sid FROM T WHERE T.song=$id)
it's just weird that it'll fetch the query and all that, but won't post any info.. thanks for the help