Advertisement
Guest User

insert

a guest
Sep 13th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. <?php
  2. //insert.php  
  3. $connect = mysqli_connect("", "", "", "");
  4. $connect->set_charset("utf8");
  5. if(!empty($_POST))
  6. {
  7.  $output = '';
  8.  $KaID = mysqli_real_escape_string($connect, $_POST["KaID"]);  
  9.     $KiID = mysqli_real_escape_string($connect, $_POST["KiID"]);  
  10.     $LID = mysqli_real_escape_string($connect, $_POST["LID"]);  
  11.     $query = "
  12.    INSERT INTO card_chest_level_m2m(KaID, KiID, LID)  
  13.     VALUES('$KaID', '$KiID', '$LID')
  14.    ";
  15.     if(mysqli_query($connect, $query))
  16.     {
  17.      $output .= '<label class="text-success">Level HinzugefĂĽgt</label>';
  18.      $select_query = "SELECT * FROM card_chest_level_m2m ORDER BY m2mID";
  19.      $result = mysqli_query($connect, $select_query);
  20.      $output .= '
  21.      <table class="table table-bordered">  
  22.                    <tr>  
  23.                         <th width="25%">Karte</th>
  24.                         <th width="25%">Kiste</th>
  25.                         <th width="25%">Level</th>      
  26.                    </tr>
  27.  
  28.     ';
  29.      while($row = mysqli_fetch_array($result))
  30.      {
  31.       $output .= '
  32.       <tr>  
  33.                         <td>' . $row["KaID"] . '</td>
  34.                         <td>' . $row["KiID"] . '</td>
  35.                          <td>' . $row["LID"] . '</td>                        
  36.                    </tr>
  37.      ';
  38.      }
  39.      $output .= '</table>';
  40.     }
  41.     echo $output;
  42. }
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement