Hey all, I have a table that has multiple CSV's like so 12, 18, 19 my code <?php require("mysql_connect.php"); $data = mysql_query("SELECT * FROM review_treatment_area"); while($row = mysql_fetch_array($data)) { $check_reviewArea = $row[area_id].", "; $pos = strpos($f_area, $check_reviewArea); if ($pos === False) { echo "<input type='checkbox' name='sel_group_area[]' value='".$row[area_id]."' />".$row[area_name]."<br />"; } else { echo "<input type='checkbox' name='sel_group_area[]' value='".$row[area_id]."' checked />".$row[area_name]."<br />"; } } ?> The issue I am having is if a table has the values 12, 18, 19 in it the dynamically generated checkboxes shown in the code above end up with checked values of 8, 9, 12, 18, 19 instead of just 12, 18, 19, and for the life of me I can't figure out a solution. Any help would be great!
You can store your values with commas on both sides, without spaces, i.e. so your $check_reviewArea can be $check_reviewArea = ','.$row['area_id'].','; PHP: