<?php $id = isset ( $_POST [ "id" ]) ? $_POST [ "id" ] : "" ; $nombre = isset ( $_POST [ "nombre" ]) ? $_POST [ "nombre" ] : "" ; $apellidos = isset ( $_POST [ "apellidos" ]) ? $_POST [ "apellidos" ] : "" ; $accion = isset ( $_POST [ "accion" ]) ? $_POST [ "accion" ] : "" ; if ( $accion ) { echo $accion ; switch ( $accion ) { case "agregar" : if (! empty ( $nombre ) && ! empty ( $apellidos )) { $conexion = conectar (); $sql = " INSERT INTO alumnos (id, nombre, apellidos) VALUES ( null , :nombre, :apellidos) " ; $consulta = $conexion -> prepare ( $sql ); $consulta -> bindParam ( ":nombre" , $nombre ); ...
Comentarios
Publicar un comentario