[eluser]millo[/eluser]
Please help.
I've got a form that looks like this:
Code:
<form action="http://test.dev/admin/document_assign_update" method="post">
<input type="hidden" name="document_id" value="1" />
<select type="text" name="username[]" multiple="multiple" size="4">
<option value="user1"><br />classname1</option>
<option value="user2"><br />classname2</option>
<option value="user3"><br />classname3</option>
</select>
<input type="submit" value="submit" />
</form>
How do I capture the data from the multiple select?
I've put something as simple as this in the controller just to see what it outputs (not using any views at the moment):
Code:
function document_assign_update() {
print_r($_POST);
}
When I don't select anything from the drop down and submit I get this output ...
Code:
Array ( [document_id] => 1 )
... which is fine, but then if I select an option from the drop down and then submit I get an error message related to the database:
Code:
An Error Was Encountered
Error Number: 1054
Unknown column 'Array' in 'where clause'
SELECT username, role FROM auth WHERE username = Array AND password = 'd41d8cd98f00b204e9800998ecf8427e'
why am I getting this error when I'm quite simply asking for the post output with print_r($_POST); ???
Can someone see what I'm doing wrong?