Which of the following query grabs the Top 10 scores from database, sorting by score and timestamp?
Answer
Correct Answer: <?php require ('connectToDatabase.php'); $query = "SELECT * FROM `userdata` ORDER by `score` ASC LIMIT 10"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "<div>No records found.</div>"; } $conn->close(); ?>
Explanation:
Note: This Question is unanswered, help us to find answer for this one