Okay, here's the whole shebang. I wrote 2 new pages to isolate the problem. I have copied each of these pages below.
The first is the input page. It pulls out all of the manufacturers from the product database, then prints them to the screen with checkboxes next to each. As the user, I checked all boxes before proceeding to page 2. The names I checked included both single word names and multi-word names. Here's page 1:
Code: Select all
<html>
<body>
<?
$conn = mysql_connect($_SESSION['host'], $_SESSION['adminUser'], $_SESSION['adminPass']);
$db = mysql_select_db($_SESSION['dbPreface']."renewabledb", $conn);
?>
<form action="test2.php" method="post">
<table>
<?
$sql="SELECT DISTINCT manu FROM panels";
$result=mysql_query($sql, $conn)or die("Could not Query: " . mysql_error());
while($panelResult=mysql_fetch_array($result)){
$panelArray[]=$panelResult[0];
}
foreach($panelArray as $panel){
echo "<tr><td></td><td><INPUT TYPE=CHECKBOX NAME=\"$panel\" VALUE= \"$panel\">$panel</td></tr>\n";
}
?>
</table>
<input type="submit" value="Next ->" name="submit">
</form>
</body>
</html>
Now the first page sends the info to page 2, which pulls out two types of info. The first is the actual name as it appears in the database. The 2nd is the name as it was retrieved through $_POST. It takes these two names and prints them to the screen, one above the other. Here's that page:
Code: Select all
<html>
<body>
<?
$conn = mysql_connect($_SESSION['host'], $_SESSION['adminUser'], $_SESSION['adminPass']);
$db = mysql_select_db($_SESSION['dbPreface']."renewabledb", $conn);
?>
<table>
<?
$sql="SELECT DISTINCT manu FROM panels";
$result=mysql_query($sql, $conn);
while($panelResult=mysql_fetch_array($result)){
$panelArray[]=$panelResult[0];
}
foreach($panelArray as $panel){
print "panelACTUAL: ".$panel."<br>";
print "panelPOST: ".$_POST[$panel]."<br><br>";
}
?>
</table>
</form>
</body>
</html>
The result? I have copied the actual printing to the screen below (with manufacturer names altered to protect the innocent):
__________________________
panelACTUAL: Big Truck
panelPOST:
panelACTUAL: Evergreen Company
panelPOST:
panelACTUAL: Ciaody
panelPOST: Ciaody
panelACTUAL: Goody
panelPOST: Goody
panelACTUAL: The News Company
panelPOST:
panelACTUAL: Sharp
panelPOST: Sharp
panelACTUAL: Townhouse
panelPOST: Townhouse
_______________________________
As you can see, only the single word names printed, whereas the multi-word ones did not. If it makes any difference, the names are stored in the mySQL table as VARCHAR(30). Thanks for the continuing help, I look forward to seeing what I'm doing wrong. Thanks.