gple Posted June 25, 2007 Share Posted June 25, 2007 If I have a list in which I can choose multiple values (ie) echo "<form action=edit_prod.php?enter=4 method=post>"; echo "<select name=type_size size=6 multiple>"; for ($i=0;$i<$num;$i++) { $type_size=mysql_result($result,$i,"type_size"); echo "<option value=".$type_size.">".$type_size."</option>"; } echo "</select>"; echo "<input type=submit name=submit value=Update></form>"; How do I bring all the values over so I can insert all the values into a table? Link to comment https://forums.phpfreaks.com/topic/57093-multiple-values-list/ Share on other sites More sharing options...
Wildbug Posted June 25, 2007 Share Posted June 25, 2007 <SELECT name="type_size[]" ....> The results will be in the array $_POST['type_size']. Link to comment https://forums.phpfreaks.com/topic/57093-multiple-values-list/#findComment-282093 Share on other sites More sharing options...
gple Posted June 25, 2007 Author Share Posted June 25, 2007 That works but the values have two words (ie Baseball Cards) and only Baseball is outputted. HOw do I get around this? Link to comment https://forums.phpfreaks.com/topic/57093-multiple-values-list/#findComment-282100 Share on other sites More sharing options...
Wildbug Posted June 25, 2007 Share Posted June 25, 2007 You should be quoting the values. <option value="Baseball cards">Baseball cards</option> ... Link to comment https://forums.phpfreaks.com/topic/57093-multiple-values-list/#findComment-282106 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.