Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. echo "Hello World";
  3. $S_ID = $_REQUEST['S_ID'];
  4. echo $S_ID;
  5. echo "Im Scum";
  6. $dbhost = 'localhost';
  7. $dbuser = 'id104366_stashcardrw';
  8. $dbpass = 'stashcarddb';
  9.  
  10.  
  11. // Create connection
  12. $mysqli = new mysqli($dbhost, $dbuser, $dbpass, "id104366_stashcards");
  13.  
  14. if ($mysqli->connect_errno) {
  15. echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
  16. }
  17. "SELECT BackText, Creator, Set_ID, FrontText FROM Cards WHERE Set_ID = $S_ID";
  18.  
  19.  
  20. $r = $mysqli->query($sql);
  21.  
  22. $result = array();
  23.  
  24. while($row = mysqli_fetch_array($r)){
  25. array_push($result,array(
  26. 'BackText' => $row['BackText'],
  27. 'Creator' => $row['Creator'],
  28. 'Set_ID' => $row['Set_ID'],
  29. 'FrontText' => $row['FrontText']
  30. ));
  31. }
  32.  
  33.  
  34. echo json_encode(array('result'=>$result));
  35.  
  36. $mysqli->close();
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement