Hi, I'm creating an administration area for a little web-app and I've come across a problem that I've never encountered before.
The form that I'm working on is used for the maintenance of a table that has several properties. One of these properties can be selected with checkboxes, and then recorded in the correct column in a comma-delimited list. The problem that I'm having is constructing/alterring the list - for some reason I can't for the life of me figure out how to do it.
Oh yeah, the fun part is that the properties that are in the checkbox are created on the fly from another table, which is why i didn't decide to create a column for each option and flag it.
Here's the snippet of code that creates the checkbox area:
<?php
$sql2 = "SELECT * FROM tbl_action";
$result = mysql_query($sql2);
while($act_row = mysql_fetch_array($result)) {
echo "<input type=checkbox value=\"".$act_row['action_id']."\"> ";
if(strstr($myrow['spy_action'], $act_row['action_id']))
echo "checked>";
echo ucwords($act_row['action_name'])."<br>";
}
?>
Ok, 2 tables - spy and action. All columns from spy are called spy_name, and from action are act_name.
So far I've considered using Javascript, making the code create a new column every time a new action is created, and various other techniques that have been thrown out as soon as I think of them.
This is the last part of the admin area, and once it's complete I'll be a very happy boy.