$i=1; While($row=mysql_fetch_array($conad)) { echo '<input type="checkbox" name="ad'.$i.'" value="'.$row[nombre].'"> '.$row[nombre].'<br>'; $i++; }