I have a multi checkbox entry that I want to place into a mysql database.
I then need to pull the array data out of the db and display into a <select> box.
I know this is easy, but have not found the way to accomplish the task.
I have tried numerous ideas I found from the web, but nothing works - most of the time I get "Array" displayed
I have tried searilize() but just get s:5:"Array" in the mysql db table column
I can create an array and work with it, no problem - but I can't get the checkbox name="[]" value"xxx" to work in any fashion - I only get "Array" to display.
so here is the code:
Code: Select all
<input type="checkbox" name="features[]" value="blue" />
<input type="checkbox" name="features[]" value="red" />
<input type="checkbox" name="features[]" value="yellow" />
<input type="checkbox" name="features[]" value="orange" />Code: Select all
if(isset($_POST['features']))
{
$features = $_POST['features'];
}
print_r($features); // = Array ( [0] => Array )
echo "<br /><br />";
var_dump($features); // = array(1) { [0]=> string(5) "Array" }So what am I doing wrong?
Any help would be appreciated...
David