DataAssist & Listing an Array
Hey WA,
I'm trying to use DataAssist to create a management system where a user can enter a result (a word in this circumstance) but be able to assign it to 1 or more categories (out of a possible 4, with scope to expand). DataAssist was able to set up most of this and get it almost there. Works fine with a single category selection but not with multiple selections.
It looks like it is storing the comma separated keys in the right column but I'm thinking the results page has issues with how it's to display multiple categories in the categories column. Also, once a user has applied multiple categories to an entry, it won't relist the same category selections on the update page.
I'm attaching the three working files that I have. It's very much out of the box, aside from the following addition to the top of the insert and update pages.
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $key => $val) {
if(is_array($_POST[$key])) $_POST[$key] = implode(", ", $_POST[$key]);
}
}
?>