mikeshallot

plz work dear god

Feb 21st, 2022
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2.  
  3. session_name("HELLO_SESSION");
  4. session_start();
  5.  
  6. echo("Authenticating to the database...\n");
  7.  
  8. $mysqli = new mysqli("host-mysql-db", "luckybyte", "Hjbbj86cX6Nw4QK3QQNnVPFpZrZh3kXm", "luckybyte");
  9.  
  10.  
  11. if ($mysqli->connect_error){
  12.     die("Failed to authenticate to the database :( \n");
  13. }
  14.  
  15. echo("Successfully authenticated! :) \n");
  16.  
  17. $stmt = $mysqli->query("SELECT * FROM users;");
  18.  
  19. echo("Running SQL query SELECT * FROM users;\n");
  20. echo("\n");
  21.  
  22.  
  23. ///////////////////////////////////////////////////// NEW
  24. while ( $rows = $stmt->fetch_assoc() ) {
  25.     print_r($rows);
  26. }
  27. ///////////////////////////////////////////////////// NEW
  28.  
  29. echo("\n");
  30. echo("Trying to bind to variable (unsure if that is what works for MySQLi)\n");
  31.  
  32. $stmt->free();
  33. $mysqli->close();
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment