- Joined
- Oct 14, 2008
- Messages
- 1,277
- Reaction score
- 249
So i have a Parse Error: Syntax Error: I've already tryed to look up with the editors that sometimes show the error but without result also I already checked : PHP parse/syntax errors on google; and how to solve them but not sure on how to fix it. Have a good day. Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file on line 24
PHP:
<?php
include 'config.php';
// connection query
$Connection = new PDO("odbc:Driver=$SQLDriver;Server=$IPAddress;Database=$DATABase;", $USERName, $PASSWORD);
// define rank number
$i = 1;
$top = $i++;
// get data query
$rankquery = "SELECT TOP 1000 * FROM Users ORDER BY userLevel, totalExp, equipItemLevel";
// prepare data query
$result = $Connection->query($rankquery);
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$top."</td><td>".$row[userName]."</td><td>".$row[userLevel]."</td><td>".$row[totalExp]."</td><td>".$row[equipItemLevel]."</td></tr>";
}
else {
echo "No data available";
}
$Connection->close();
?>