Advertisement
Guest User

Untitled

a guest
May 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "'xxxxx";
  4. $password = "xxxxx";
  5. $dbname = "xxxxx";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password); **//line 8**
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. } else {
  13. echo "no connection";
  14. }
  15.  
  16. $sql = "SELECT * FROM pages";
  17. $result = $conn->query($sql);
  18.  
  19. $data = array();
  20. $arr = array();
  21.  
  22. if ($result->num_rows > 0) {
  23. // output data of each row
  24. while($row = $result->fetch_assoc()) {
  25.  
  26. }
  27. } else {
  28. echo "No Token";
  29. }
  30. print_r(json_encode($data));
  31. $conn->close();
  32.  
  33. ?>
  34.  
  35. 1.CREATE USER 'user'@'localhost' IDENTIFIED BY '123456789';
  36. 2.
  37. 3.GRANT ALL PRIVILEGES ON project.* TO 'user'@'localhost' WITH GRANT OPTION;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement