What I am trying to do here is say this:$sqlconn=@mysql_connect("localhost","user","pass");
$rs=@mysql_select_db("dbname",$sqlconn);
$query = ("SELECT OtherDept FROM intrastaff WHERE id = '$id'");
$result = mysql_query($query);
while($row = mysql_fetch_object($result))
if (stripos($row['OtherDept'],"Company Commercial")!==false)
{
echo "<input type='checkbox' name='dept[]' value='$row->OtherDept' checked>$row->OtherDept<br/>";
}
else
{
echo "<input type='checkbox' name='dept[]' value='$row->OtherDept'>$row->OtherDept<br/>";
}
mysql_close($sqlconn);
Render all Departments from intradepartment (table) and place a tick in the checkbox where there is a matching entry in intrastaff.
I know intradepartment isn't shown here now as I was trying something else, but I hope this will give u the idea.
In the end, this will all render as one form with two other connections, and be able to submit the data to a MySQL database.
I just can't get it to produce all boxes, and then tick those where both match.
Hope someone can help.
Simon