Guest User

Untitled

a guest
Apr 22nd, 2018
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password ="";
  5. $dbName = "basketball_simulator";
  6.  
  7.  
  8. //make Connection
  9. $conn = new mysqli($servername, $username, $password, $dbName);
  10. //check Connection
  11. if(!$conn){
  12. die("Connection Failed.". mysqli_connect_error());
  13. }
  14.  
  15. $sql = "SELECT ID, Score, Shots FROM basketball_simulatorr";
  16. $result = mysqli_query($conn ,$sql);
  17.  
  18. if(!$result || mysqli_num_row($result) == 0) {
  19. while($row = mysqli_fetch_assoc($result)){
  20. echo "Id:".$row['ID']."Score:".$row['Score']."Shots".$row['Shots'].";";
  21. }
  22. }
Add Comment
Please, Sign In to add comment