Advertisement
Guest User

Untitled

a guest
May 25th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?php
  2.  
  3. if($_SERVER['REQUEST_METHOD']=='POST'){
  4.  
  5. //Getting values
  6. // $email = $_POST['email'];
  7.  
  8.  
  9. $servername = "localhost";
  10. $username = "root";
  11. $password = "";
  12. $database = "androiddb";
  13.  
  14. // Create connection
  15. $conn = new mysqli($servername, $username, $password, $database);
  16.  
  17. // Check connection
  18. if ($conn->connect_error) {
  19. die("Connection failed: " . $conn->connect_error);
  20. }
  21. else{
  22. echo "connedted";
  23. }
  24.  
  25.  
  26. $sql = "select * from userdefault";
  27. $stmt = $conn->prepare($sql);
  28.  
  29. $stmt->execute();
  30.  
  31. $result = $stmt->get_result();
  32.  
  33. while ($row = $result->fetch_assoc()){
  34.  
  35. echo $row['0'] + " " +$row['1'] + " " +$row['2'] + " ";
  36. }
  37.  
  38. mysqli_close($conn);
  39.  
  40. ?>
  41.  
  42. if($_SERVER['REQUEST_METHOD']=='POST'){
  43.  
  44. //Getting values
  45. // $email = $_POST['email'];
  46.  
  47.  
  48. $servername = "localhost";
  49. $username = "root";
  50. $password = "";
  51. $database = "androiddb";
  52.  
  53. // Create connection
  54. $conn = new mysqli($servername, $username, $password, $database);
  55.  
  56. // Check connection
  57. if ($conn->connect_error) {
  58. die("Connection failed: " . $conn->connect_error);
  59. }
  60. else{
  61. echo "connedted";
  62. }
  63.  
  64.  
  65. $sql = "select * from userdefault";
  66. $stmt = $conn->prepare($sql);
  67.  
  68. $stmt->execute();
  69.  
  70. $result = $stmt->get_result();
  71.  
  72. while ($row = $result->fetch_assoc()){
  73.  
  74. echo $row['0'] + " " +$row['1'] + " " +$row['2'] + " ";
  75. }
  76.  
  77. mysqli_close($conn);
  78.  
  79. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement