Hi Laurus,
Not sure how you store your info. In these cases I use this structure:
One table with the keywords:
<id><label>
On table with the data
<id><..>
One table between them:
<keyword_id><data_id>
That allows you to query all the keywords for a certain datatype (Taken from my script linking keywords to pictures):
// ------------- Get themes -------------------------------------------------
$ThemeResult = mysql_query("select * from ImgToTheme where I_F_Nr = $id");
while($ThemeRow = mysql_fetch_array($ThemeResult))
{
$ThemeSelected[$ThemeRow['I_T_Nr']] = " checked ";
}
and when you retrieve all the themes later on, to create all the checkboxes you use this info:
// ------------- Themelist ----------------------------------------------
$themeresult = mysql_query("select * from theme");
while ($theme = mysql_fetch_array($themeresult))
{
$themelist .= "<input type=checkbox ".$ThemeSelected[$theme['T_Id']]." name=Theme[] value=".$theme['T_Id'].">".$theme['T_Theme']."<br>
";
}