Hi guys, me again.
Having an issue with a multiple select form object that is generated through PHP and retrieves and displays MYSQL values.
it displays and retrieves correctly and PHP produces is correctly, however, the form submission to post the values to MYSQL do not, instead it posts the first item selected only instead of all of them.
Any help is greatly appreciated as this has been annoying me for days!
<form action="addproductpost.php?sel=<?php echo $selectedvalue; ?>" enctype="multipart/form-data" method="post">
<div class="style3"> <br />
<table width="568" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="style1">
<td><div align="center" class="style1 style19 style20">Select Functions</div></td>
<td><div align="center" class="style21"><span class="style11"><span class="style22">Add a Product</span></span></div></td>
</tr>
<tr>
<td width="92"><label>
<?php
$con = mysql_connect($sqlserver,$sqluser,$sqlpassword);
if (!$con)
{
die('Connection to SQL Server failed. Error: ' . mysql_error());
}
mysql_select_db($sqldb, $con);
$result = mysql_query("SELECT functions FROM functions");
?>
<select id="func" name="func" multiple="multiple">
<?php
if (mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
?>
<option atomicselection="on" value="<?php echo "$row[functions]"; ?>"><?php echo "$row[functions]"; ?></option>";
<?php
}
}
?>
</select>
<?php
mysql_close($con)
?>
</label></td>
<td width="476"><p align="center"><span class="style1"><strong><strong><strong><strong>Product Name:</strong><strong><br />
<input name="productname" type="text" class="style14" style="width: 400px" id="productname" >
<span class="style14"> </span></strong><br>
<br >
Product INCI:</strong></strong><strong><span class="style2"><strong><strong><br >
<textarea name="productinci" rows="3" cols="1" wrap="virtual" class="style14" id="productinci" style="width: 400px"></textarea>
<br >
<br >
</strong></strong></span></strong>Product Detailed Description:</strong></span><strong><br class="style14" />
<textarea cols="15" name="productdescription" rows="1" class="style14" style="width: 400px; height: 142px" id="productdescription"></textarea>
</strong></p>
<div align="center"><strong></strong></div>
<strong>
<div align="center"></div>
</strong>
<div align="center">
<table width="100%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="239" class="style5" style="height: 23px"><strong>
<label id="Label1"></label>
</strong> <label><span class="style1">Supplier:</span><br />
<?php
$con = mysql_connect($sqlserver,$sqluser,$sqlpassword);
if (!$con)
{
die('Connection to SQL Server failed. Error: ' . mysql_error());
}
mysql_select_db($sqldb, $con);
$result = mysql_query("SELECT supplier FROM suppliers");
?>
<SELECT name="supplist">
<?php
if (mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
?>
<option value="<?php echo "$row[supplier]"; ?>"><?php echo "$row[supplier]"; ?></option>
<?php
}
}
?>
</SELECT>
<?php
mysql_close($con)
?>
</label></td>
<td width="238" class="style5" style="height: 23px"><strong>
<input name="Submit" style="width: 125px" type="submit" value="Add product" class="style14" />
</strong></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
</form>