I have a form with this field in it. Which calls from a skills table that has 2 columns – the skill_id(int) and the skill(varchar). I want the user to choose multiple choices for the skills they have and add this to their information but only 1 choice is going through.
print ("<tr><td valign=top>Skill: </td><td><select name=uskill_id[0] size=3 multiple=multiple>");
global $wpdb;
$trade = $wpdb->get_results("select skill, skill_id from wp_skill", ARRAY_A);
foreach($trade as $row) {
$skill = $row['skill'];
$skill_id = $row['skill_id'];
print '<option value="'.$skill_id.'">'.$skill.'</option>';
}
Here is the insert statement which will send the info to the database. The skill_id I have turned into a varchar type from an int type but still no luck.
global $wpdb; $success=$wpdb->insert('trades', array('skill_id' => explode(', ', $_POST['uskill_id[0]'])));
use this form