Advertisement
Guest User

puntuar

a guest
Feb 19th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <?php
  5.  
  6. include("estructura/conecta.php");
  7. include("estructura/meta_tags.php");
  8.  
  9. session_start();
  10.  
  11. $local=$_POST['local'];
  12. $visitante=$_POST['visitante'];
  13. $marca=$_POST['marca']; /*el jugador que MARCA*/
  14. $tanto=$_POST['tanto']; /*1 2 3*/
  15.  
  16. switch ($tanto) {
  17. case 'uno':
  18. $tantostotal=mysql_query("SELECT tantos_marcados from jugadores where codalumno='$marca'");
  19. while($total=mysql_fetch_array($tantostotal)){
  20. $tantos=$total['tantos_marcados']+1;
  21. $sql="UPDATE jugadores set tantos_marcados=$tantos where codalumno='$marca'";
  22. if (mysql_query($sql)) {
  23. header("location:partido.php");
  24. }
  25. else{
  26. echo "NO SE PUEDE ACTUALIZAR ".mysqli_error($con2);
  27. }
  28. }
  29. break;
  30. case 'dos':
  31. $tantostotal=mysql_query("SELECT tantos_marcados from jugadores where codalumno='$marca'");
  32. while($total=mysql_fetch_array($tantostotal)){
  33. $tantos=$total['tantos_marcados']+2;
  34. $sql="UPDATE jugadores set tantos_marcados=$tantos where codalumno='$marca'";
  35. if (mysql_query($sql)) {
  36. header("location:partido.php");
  37. }
  38. else{
  39. echo "NO SE PUEDE ACTUALIZAR ".mysqli_error($con2);
  40. }
  41. }
  42. break;
  43. case 'tres':
  44. $tantostotal=mysql_query("SELECT tantos_marcados from jugadores where codalumno='$marca'");
  45. while($total=mysql_fetch_array($tantostotal)){
  46. $tantos=$total['tantos_marcados']+3;
  47. $sql="UPDATE jugadores set tantos_marcados=$tantos where codalumno='$marca'";
  48. if (mysql_query($sql)) {
  49. header("location:partido.php");
  50. }
  51. else{
  52. echo "NO SE PUEDE ACTUALIZAR ".mysqli_error($con2);
  53. }
  54. }
  55. break;
  56. }
  57. mysql_close($con2);
  58. ?>
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement