Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "ronnydar_admin";
  4. $password = "Somnifer123";
  5. $dbname = "ronnydar_hr";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. $sql = "SELECT * FROM pics ORDER BY RAND() LIMIT 1";
  15. $result = $conn->query($sql);
  16.  
  17. if ($result->num_rows > 0) {
  18. // output data of each row
  19. while($row = $result->fetch_assoc()) {
  20. $id = $row["id"];
  21. $dir = $row["dir"];
  22. $likes = $row["likes"]
  23. } else { //LINE 23
  24. echo "0 results";
  25. }
  26. $conn->close();
  27. ?>
  28.  
  29.  
  30.  
  31.  
  32.  
  33. ================
  34. Error Log
  35. ================
  36.  
  37. [22-Jan-2017 17:15:18 America/New_York] PHP Parse error: syntax error, unexpected '}' in /home/ronnydar/public_html/hrate/index.php on line 23
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement