Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $dbname = $_GET['schema'];
- $host = $_GET['host'];
- $username = $_GET['user'];
- $pass = $_GET['pass'];
- $uid = $_GET['uid'];
- $tbname = "xpsystem";
- $port = $_GET['port'];
- $host = $host . ':' . $port;
- $querycheck = "select XP,Perks from $tbname WHERE PlayerUID = '$uid'";
- $con = mysqli_connect($host,$username,$pass) or die("Unable to Connect");
- mysqli_select_db($con,$dbname);
- $result = mysqli_query($con,$querycheck);
- if(mysqli_num_rows($result)>0)
- {
- $columncount = mysqli_num_fields($result);
- $convertedresult = "";
- while ($row = mysqli_fetch_row($result)) {
- $convertedresult = $convertedresult . "[";
- for($i=0;$i < $columncount;$i++) {
- $convertedresult = $convertedresult . $row[$i] . ",";
- };
- $convertedresult = substr($convertedresult,0,-1);
- $convertedresult = $convertedresult . "],";
- };
- returndata(substr($convertedresult,0,-1));
- } else
- {
- $query = "INSERT INTO $tbname VALUES ('$uid',100,'[]')";
- mysqli_query($con,$query);
- $result = mysqli_query($con,$querycheck);
- $columncount = mysqli_num_fields($result);
- $convertedresult = "";
- while ($row = mysqli_fetch_row($result)) {
- $convertedresult = $convertedresult . "[";
- for($i=0;$i < $columncount;$i++) {
- $convertedresult = $convertedresult . $row[$i] . ",";
- };
- $convertedresult = substr($convertedresult,0,-1);
- $convertedresult = $convertedresult . "],";
- };
- returndata(substr($convertedresult,0,-1));
- }
- function returndata($dat)
- {
- echo '<data>'. $dat .'</data>';
- }
- mysqli_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement