1. <?php
  2. $link = mysqli_connect('localhost','mahdi','***','valiasr');
  3. mysqli_set_charset($link,'utf8');
  4. $query = "select * from colleges";
  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='college' value="."$row[id]".">" .$row['name']." ";
  10. }
  11. ?>

college