I set up mySQL cell named \"Type\" and as a set(\'All\', \'Conventional\', \'Course\')
Now, my forms are set-up as:
<input type=\"hidden\" name=\"Type\" value=\"$set$\" />
<select name=\"Type\" size=3 multiple=\"multiple\">
And it only allows me to input 1 option. I\'m lost. Any ideas. Thank you very much.
NEED HELP inputing array into mysql!
1 reply to this topic
Posted 21 July 2003 - 04:52 PM
For different MySQL data types, use inputs phpMyAdmin is using, this can help: (ref: http://www.phpmyadmin.net).
varchar, int, char, float: use input of type text (or password).enum: use select or radio buttons (one choice only)set: use select with attribute multiple="multiple" and a size="x" where x is min(number of items, 7) (note: 7 is a magic number for interfaces displaying item listings) or checkboxes (multiple choices)text: use textareaFor your situation, since you only have 3 choices, I would use checkboxes. They all have the same name (name=\"Type\") only their value are different. To insert their values into MySQL, simply use implode() method:
// let\'s say values are in $_POST[\'Type\']:$sql = "INSERT INTO table SET Type = \'".implode(",", $_POST[\'Type\'])."\'";JP.
Unfortunately, PHP \'empowered every moron with a copy of Windows notepad to be \"web programmers\". (...) Give PHP a real INFRASTRUCTURE. Use PEAR!!!\'
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users