Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <?php
- include("estructura/conecta.php");
- include("estructura/meta_tags.php");
- session_start();
- $local=$_POST['local'];
- $visitante=$_POST['visitante'];
- $marca=$_POST['marca']; /*el jugador que MARCA*/
- $tanto=$_POST['tanto']; /*1 2 3*/
- switch ($tanto) {
- case 'uno':
- $tantostotal=mysql_query("SELECT tantos_marcados from jugadores where codalumno='$marca'");
- while($total=mysql_fetch_array($tantostotal)){
- $tantos=$total['tantos_marcados']+1;
- $sql="UPDATE jugadores set tantos_marcados=$tantos where codalumno='$marca'";
- if (mysql_query($sql)) {
- header("location:partido.php");
- }
- else{
- echo "NO SE PUEDE ACTUALIZAR ".mysqli_error($con2);
- }
- }
- break;
- case 'dos':
- $tantostotal=mysql_query("SELECT tantos_marcados from jugadores where codalumno='$marca'");
- while($total=mysql_fetch_array($tantostotal)){
- $tantos=$total['tantos_marcados']+2;
- $sql="UPDATE jugadores set tantos_marcados=$tantos where codalumno='$marca'";
- if (mysql_query($sql)) {
- header("location:partido.php");
- }
- else{
- echo "NO SE PUEDE ACTUALIZAR ".mysqli_error($con2);
- }
- }
- break;
- case 'tres':
- $tantostotal=mysql_query("SELECT tantos_marcados from jugadores where codalumno='$marca'");
- while($total=mysql_fetch_array($tantostotal)){
- $tantos=$total['tantos_marcados']+3;
- $sql="UPDATE jugadores set tantos_marcados=$tantos where codalumno='$marca'";
- if (mysql_query($sql)) {
- header("location:partido.php");
- }
- else{
- echo "NO SE PUEDE ACTUALIZAR ".mysqli_error($con2);
- }
- }
- break;
- }
- mysql_close($con2);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement