1. <?php
  2. $link = mysqli_connect('localhost','mahdi','****','valiasr');
  3. mysqli_set_charset($link,'utf8');
  4. $query = "select * from groups where college_id=".$_GET['collegeid'];
  5. $result = mysqli_query($link,$query);
  6. $rows = mysqli_fetch_all($result,MYSQLI_ASSOC);
  7. foreach($rows as $row)
  8. {
  9. echo "<input type='checkbox' class='group collegeid{$_GET[collegeid]} ' value=$row[id]>
  10. <span class='group collegeid{$_GET[collegeid]}'> $row[name] </span>";
  11. }
  12. ?>

getgroup.php