I am trying display a bunch of check boxes from a database (this part works) the user can then click the boxes and save them to their user preferences (this part works as well) But when i am displaying all the options, I would like the user to see which groups are checked by automatically checking the items he has in his db.
here is my code:
<html>
<head>
<title>Web Interface</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
require("database.inc.php");
dbconnect();
$keyword = $_POST["search"];
$query = "SELECT ng_id,group FROM groups WHERE group like '%$keyword%' limit 10";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
if($num_rows == 0) {
echo "No results<BR>\n";
} else {
while($row = mysql_fetch_array($result)) {
?>
<form name=checks action=checkboxs.php method=post>
<input type="checkbox" name="checks[]" value="<?php echo $row['0']; ?>" > <?php echo $row['1']; ?><BR>
<?PHP
}
echo" <input type=submit value=Save>";
}
?>
</body></html>