daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.                 if(isset($_POST['submit'])) {
  3.                     $cupname = $_POST['cupname'];
  4.                     $team1 = $_POST['team1'];
  5.                     $team2 = $_POST['team2'];
  6.                     $team3 = $_POST['team3'];
  7.                     $team4 = $_POST['team4'];
  8.  
  9.                     $zero = "0";
  10.  
  11.                     $result = mysql_query("INSERT INTO cupname (name) VALUES ('$cupname')");
  12.                     $result = mysql_query("INSERT INTO teams (team1, team2, team3, team4) VALUES ('$team1', '$team2', '$team3', '$team4')");
  13.                     $result = mysql_query("INSERT INTO wins (team1w, team2w, team3w, team4w) VALUES ($zero, $zero, $zero, $zero)");
  14.                     $result = mysql_query("INSERT INTO draws (team1d, team2d, team3d, team4d) VALUES ($zero, $zero, $zero, $zero)");
  15.                     $result = mysql_query("INSERT INTO looses (team1l, team2l, team3l, team4l) VALUES ($zero, $zero, $zero, $zero)");
  16.                     $result = mysql_query("INSERT INTO points (team1p, team2p, team3p, team4p) VALUES ($zero, $zero, $zero, $zero)");
  17.                 echo "<h1>Turnering og lag lagt til!</h1>";
  18.                 }
  19.  
  20.                 ?>
  21.    
  22. <?php
  23.                 $result = mysql_query("SELECT * FROM cupname ORDER BY id DESC");
  24.                 $result = mysql_query("SELECT * FROM teams ORDER BY id DESC");
  25.                 $result = mysql_query("SELECT * FROM wins ORDER BY id DESC");
  26.                 $result = mysql_query("SELECT * FROM draws ORDER BY id DESC");
  27.                 $result = mysql_query("SELECT * FROM looses ORDER BY id DESC");
  28.                 $result = mysql_query("SELECT * FROM points ORDER BY id DESC");
  29.                     while($row = mysql_fetch_array($result)) {
  30.                         $i=$i + 1;
  31.                         echo "<table>";
  32.                         echo "<tr>";
  33.                         echo $row['name'];
  34.                         echo "</tr>";
  35.                         echo "<tr><td><b>Lag</b></td>
  36.                         <td><b>Seiere</b></td>
  37.                         <td><b>Uavgjort</b></td>
  38.                         <td><b>Tap</b></td>
  39.                         <td><b>Poeng</b></td>
  40.                         </tr><tr><td>";
  41.                         echo $row['team1'];
  42.                         echo "</td><td>";
  43.                         echo $row['team1w'];
  44.                         echo "</td><td>";
  45.                         echo  $row['team1d'];
  46.                         echo "</td><td>";
  47.                         echo  $row['team1l'];
  48.                         echo "</td><td>";
  49.                         echo  $row['team1p'];
  50.                         echo "</td></tr><tr><td>";
  51.                         echo  $row['team2'];
  52.                         echo  "</td><td>";
  53.                         echo  $row['team2w'];
  54.                         echo "</td><td>";
  55.                         echo  $row['team2d'];
  56.                         echo "</td><td>";
  57.                         echo  $row['team2l'];
  58.                         echo "</td><td>";
  59.                         echo  $row['team2p'];
  60.                         echo "</td></tr><tr><td>";
  61.                         echo  $row['team3'];
  62.                         echo  "</td><td>";
  63.                         echo  $row['team3w'];
  64.                         echo "</td><td>";
  65.                         echo  $row['team3d'];
  66.                         echo "</td><td>";
  67.                         echo  $row['team3l'];
  68.                         echo "</td><td>";
  69.                         echo  $row['team3p'];
  70.                         echo "</td></tr><tr><td>";
  71.                         echo  $row['team4'];
  72.                         echo  "</td><td>";
  73.                         echo  $row['team4w'];
  74.                         echo "</td><td>";
  75.                         echo  $row['team4d'];
  76.                         echo "</td><td>";
  77.                         echo  $row['team4l'];
  78.                         echo "</td><td>";
  79.                         echo  $row['team1p'];
  80.                         echo "</td></tr></table><br /><hr /><br />";
  81.                     }
  82.                 ?>
  83.    
  84. select
  85.     tourn.id,
  86.     tourn.name
  87. from
  88.     tournament
  89.         join teams team
  90.             on tourn.id=team.id
  91.         join wins win
  92.             on tourn.id=win.id
  93.    
  94. select
  95.     tourn.id,
  96.     tourn.name
  97. from
  98.     tournament
  99.         right outer join teams team
  100.             on tourn.id=team.id
  101.         right outer join wins win
  102.             on tourn.id=win.id
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top