View difference between Paste ID: Q78sLsUg and 9S7hmY5c
SHOW: | | - or go back to the newest paste.
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
    }
24
} else {  //LINE 23
25
    echo "0 results";
26
}
27
$conn->close();
28
?>
29
30
31
32
33
34
================
35
	Error Log
36
================
37
38
[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