Para que sea parecido al tuyo, con while():
Código PHP:
Ver original<?php
/** Prueba conexión BBDD y consulta (MySQL) **/
$conn = conectadb('test'); // cambiar por tú conexión
$sql = "SELECT * FROM dept RIGHT JOIN emp ON emp.deptid=dept.deptid;"; // cambiar por tú consulta
/** **/
?>
<style type="text/css">
table { border: 1px solid #000;padding: 2px;
font: 10px;width: 433px;height: 48px;
}
td {border: 1px solid #999;}
input {font: 10px;}
</style>
<form action="" name="form" method="post">
<table>
<tr>
<th scope="col">
<!-- -->
<table>
<thead>
<tr>
<th width="172">NOMBRE</th>
<th width="101">MINISTERIO</th>
<th width="20">DV</th>
<th width="20">C.O</th>
<th width="20">C.E</th>
<th width="20">C.A</th>
<th width="20">ALB</th>
<th width="24">VIG</th>
</thead>
<tbody>
<?php
$i = 0;
$nomb = $row['name'];
$min = $row['dept'];
echo '<tr>';
echo"
<td><input id='nombres' type='text' name='nombr[$i]' size=37 value='$nomb'readonly></td>
<td><input id='min' type='text' name='min[$i]' value='$min' readonly></input></td>";
/** ckeckbox **///DV C.O C.E C.A ALB VIG
echo "
<td><input type='checkbox' name='fila1[dv][$i]' value=1></td>
<td><input type='checkbox' name='fila1[co][$i]' value=2></td>
<td><input type='checkbox' name='fila1[ce][$i]' value=3></td>
<td><input type='checkbox' name='fila1[ca][$i]' value=4></td>
<td><input type='checkbox' name='fila1[alb][$i]' value=5></td>
<td><input type='checkbox' name='fila1[vig][$i]' value=6></td>";
echo '</tr>';
$i++;
}
?>
</tbody>
</table>
</th>
</tr>
</table>
<div class="demo">
<!-- -->
Fecha:
<?php
// fija el select en una opción
if (isset($_POST['fecha'])) { echo "<input type='date' name='fecha' size='8' maxlength='10' value='".$_POST['fecha']."' />";
} else {
echo "<input type='date' name='fecha' size='8' maxlength='10' value='".date('Y-m-d')."' />"; }
?>
<!-- -->
<input type="submit" name="nuevafecha" value="Enviar" />
</div>
</form>
<?php
if(isset($_POST['nuevafecha'])) {
echo $_POST['fecha'];
echo '<hr>';
echo '<hr>';
echo '<hr>';
}
?>