[eluser]Unknown[/eluser]
Hello,
I cannot handle this issue. I am trying to get values from multiple select and store them in the database. Could you please take a look at this and let me know what is wrong with this? Why my selection are not stored in array so i can insert them in the database.
My form:
Code:
<form name="choiceForm" method="POST" action="create">
<select name="users[]" id="project-users">
<?php if($displayProjectStatus): ?>
<?php foreach($displayProjectStatus as $status): ?>
<option class="drop-option" value="<?= $status->ID_PROJECT_STATUS ?>"> <?= $status->PROJECT_STATUS_NAME ?></option>
<?php endforeach ?>
<?php else: ?>
<option class="drop-option">Cannot display users. </option>
<?php endif ?>
</select>
</fieldset>
<input type="submit" value="Submit" 100px;"/>
</form>
My controller:
Code:
$dataUsers = array(
'ID_USER' =>$this->input->post('users')
);
$this->db->insert_batch('arrayusers', 'ID_USER', $dataUsers);
I get a lot of errors when using the above code in controller regarding Argument #1 is not an array, The first argument should be an array etc. I tried some other codes but still the same or it stores 0 to db. Any idea how to handle this?