Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <?php
  2. $url = "127.0.0.1";
  3. $user = "username";
  4. $pass = "password";
  5. $conn = mysqli_connect("$url","$user","$pass","space");
  6. ?>
  7.  
  8. <html>
  9. <head>
  10. <?
  11. include 'db.php';
  12. ?>
  13. <!-- Header stuff -->
  14. </head>
  15. <body>
  16. <!-- Body stuff -->
  17. <?php
  18. $spaceSelect = mysqli_query($conn, "SELECT * FROM `world`");
  19. $i = 1;
  20. while($space = mysqli_fetch_array($spaceSelect)){
  21. echo "<button id='sector' data-toggle='modal' data-target='#".$space['id']."Modal'>".$space['id']."</button>";
  22. $i += 1;
  23. if($i % 10 == 1){
  24. echo "<br>";
  25. };
  26. echo "stuff";
  27. };
  28. ?>
  29. </body>
  30. </html>
  31.  
  32. Notice: Undefined variable: conn in S:sharedspaceindex.php on line 30
  33.  
  34. <html>
  35. <head>
  36. <?
  37.  
  38. ?>
  39. <!-- Header stuff -->
  40. </head>
  41. <body>
  42. <!-- Body stuff -->
  43. <?php
  44. include 'db.php';
  45. $spaceSelect = mysqli_query($conn, "SELECT * FROM `world`");
  46. $i = 1;
  47. while($space = mysqli_fetch_array($spaceSelect)){
  48. echo "<button id='sector' data-toggle='modal' data-target='#".$space['id']."Modal'>".$space['id']."</button>";
  49. $i += 1;
  50. if($i % 10 == 1){
  51. echo "<br>";
  52. };
  53. echo "stuff";
  54. };
  55. ?>
  56. </body>
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement