It seems like a simple thing and yet I cannot get it to work - stored array back into single select or list dropdown

Although it was a bit of a learning curve, it turns out saving data into a table field as a comma delimited array works well and making choices of that array in a multi-select in a form also works well… but I cannot seem to fathom how to bring that stored array (text serial numbers) back onto a page as either a non-multi-select or even as a list dropdown. The field where the data is stored is good, and I can get a double row of both stored serial numbers: PB0004-10001,PB0004-10002 and even though I am using split, I am getting this in the select (the choice is meant to trigger a goto that does work):

Capture

The code looks like this:


The conn_units.data.getSerials_user is a query that filters the database to a single user by logged-in identity and shows that specific array field, if a general query is needed that would be conn_units.data.getSerials and it would show ALL stored serial numbers before any filtering (this was needed when creating the original insert). This is all in a form but it does not get submitted… the select items all use a dmx-on:changed="browser1.goto - I tried using a $_GET and the same thing is showing, the proper rows count of two items but both show both array items.

There are many lessons on adding data into an array, but maybe a quick detailed lesson on bringing that array back onto a page or into a select as an item to choose from (not as an update) please? This is a 30-second job if just bringing in a regular database query but the split has had me flummoxed for 2 days now.

Community Page
Last updated: