Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/06/2010, 19:01
Slyfer_1987
 
Fecha de Ingreso: junio-2010
Mensajes: 6
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: Ayuda Urgente

Por lo que entendí, hice estos scripts con tus dudas, me gustaría que dieras más detalles de lo que deseas, y que pruebes mis scripts y me digas si están mal o si más a o menos así es lo que quieres...

Este es el script donde el maestro ingresará las notas (nota1 y nota2):

Código PHP:
<?php
$dbhost
="localhost"
$dbuser="root"
$dbpass="password"
$db="bd"
mysql_connect("$dbhost","$dbuser","$dbpass");
mysql_select_db("$db");?>
<html>
<head>
<title></title>
<body>
    <form id="form1" name="form1" method="post" action="">
        <table width="200" border="1">
            <?php
                $sql
='select id,nombre from alumno';
                
$result mysql_query($sql);
                
$num_filas mysql_num_rows($result);
            
?>
            <tr>
                <td>alumno</td>
                <td>nota1</td>
                <td>nota2</td>
                <td>enviar</td>
            </tr>
            <?php
            
if ($num_filas 0
            {
                while(
$fila mysql_fetch_object($result))
                {
                    
$id $fila->id
                    
$nombre $fila->nombre;?>
                    <tr>
                        <td><?php echo $nombre ?></td>
                        <td><input type="text" name="nota1"/></td>
                        <td><input type="text" name="nota2"/></td>
                        <td><a href="enviar.php?id=<?php echo $fila->id ?>"title="Enviar" /><input type="submit" value="enviar"/></td>
                    </tr>
                <?php 
                

            }
            
?>    
        </table>
    </form>
</body>
</html>
Únicamente faltaría realizar el script envió para hacer la inserción de las notas en la base de datos.