mi codigo es el siguiente
Código PHP:
<?php
echo '<body bgcolor=#FFFFFF text=#000000>
<table id="table4" borderColor="#666666" width="700" align="left" bgColor="#FFFFFF" border="0">
<tr>
<td height="51"><font color="#000000">
<table border="0" width="100%" id="table7">
<tr>
<td></td>
</tr>
</table>';
require('config.php');
mysql_connect($server,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM CONTROL ORDER BY 'Name' ASC";
$result=mysql_query($query);
$num=mysql_num_rows($result);
echo "<hr>";
$i=0;
while ($i < $num) {
$Name=mysql_result($result,$i,"Name");
$ID=mysql_result($result,$i,"ID");
$Address=mysql_result($result,$i,"Address");
$City=mysql_result($result,$i,"City");
$Postal=mysql_result($result,$i,"Postal");
$MATERNO=mysql_result($result,$i,"MATERNO");
$SINO=mysql_result($result,$i,"SINO");
#$IP_Address=mysql_result($result,$i,"IP_Address");
#$ID=mysql_result($result,$i,"ID");
echo '<form method="post" action="'.$PHP_SELF.'">
<p align="left">Matricula: <input type="text" name="ASIMATRICULA" value="'.$Address.'" <p align="left">Nombre: <input type="text" name="ASISNombre" value="'.$Name.'" <p align="left"> Dia/Mes/Año: <input type="text" name="ASISDIAMES" value="'.date("d/m/Y").'" size="15">
<p align="right">Asistencia:<input type=radio name=SINO value=1 Checked>Asistio <input type=radio name=SINO value=0>Falto</p>
</form>';
$i++;
}
mysql_close();
echo '<table border="0" width="97%" id="table6">
<tr>
</tr>
<tr>
<td></td>
</tr>
</table>
</font></td>
</tr>
</table>';
?>
<div>
<?php
$server = "localhost";
$user = "admin";
$pass = "trq7b51xwg2f";
$db = "bases22";
$conec = @mysql_connect("$server", "$user", "$pass");
$dbconec = @mysql_select_db($db) or die (mysql_error());
if (isset($_POST['IN'])){
$sql = "INSERT INTO ASISTENCIA (ASISNombre,ASIMATRICULA,ASISDIAMES,SINO) VALUES ('".$_POST['ASISNombre']."','".$_POST['ASIMATRICULA']."','".$_POST['ASISDIAMES']."','".$_POST['SINO']."')";
$resp = mysql_query($sql, $conec) or die (mysql_error());
}else{
echo '<form method="post" action="'.$PHP_SELF.'">
<input type="submit" name="IN" value="Insertar">
</form>';
}
?>
</div>