Advertisement
Guest User

Mat123321g: HTTP service to PHP/Mysql rbx

a guest
Oct 10th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>Data from Roblox</title>
  4.     <h3>Data from Roblox</h3>
  5. </head>
  6. <body>
  7.     <?php
  8.     //Change what needs changed (var names, tables, database, rows)
  9.         $Var2 = $_POST["VarName1"];
  10.         $Var2 = $_POST["VarName2"];
  11.         $con = new mysqli("localhost","user","pass","Database");
  12.         if(mysqli_connect_errno()){
  13.             echo(mysqli_connect_error());
  14.         }
  15.         if($name!=NULL and $age != NULL){
  16.             $con->query("INSERT INTO Table (Var1,Var2) VALUES ('$Var1','$Var2')");
  17.         }
  18.         $result = $con->query("SELECT * FROM Table");
  19.         if($result->num_rows > 0){
  20.             echo("Rows: <br>");
  21.             while($row = $result->fetch_assoc()){
  22.                 echo($row["Var1"] . ": " . $row["Var2"] . "<br>");
  23.             }
  24.         }
  25.         else{
  26.             echo("Database is empty");
  27.         }
  28.     ?>
  29. </body>
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement