Good evening!
How do I list a query in the database?
I have a bank where you store Singers and their songs ...
I would like to list spotify style, listing numerically according to the amount of content in the bank.
I see my example:
Code:
<?php$mysqli=newmysqli("host", "user", "senha", "db");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$count = 1;
if ($sth = $mysqli->query("SELECT * FROM artistas")){
while ($row = $sth->fetch_assoc()){
echo $count . " - " . $row['cantor'] . "<br>";
$count++;
}
}
Result: