I have a table in the multi-line database,
I wanted to get the highest id, which has status = 1, how can I do this with php? The id is one column of the table and the status is another.
Then I also want to know how to get the least elevated.
<?php
$link = mysqli_connect("localhost", "root", "vertrigo", "csgodouble");
$contador = 0;
$verifica = mysqli_query($link, "SELECT MAX(id) FROM apostas WHERE status = 1 ");
$sql = mysqli_fetch_array($verifica);
echo $sql["numero_sorteado"];
?>