Hello, I'm developing an online management system (fifa, pes) and I'm having a problem, now I'm doing the part where the user will post the result of the game, informing the scoreboard and the players who made the goals , for this I need to access the database and select the list of players of the user's club and put them in a button in the form of select pro user only click, I am beginner would like to know how I do this, with which function, follows example of my code where I could get the DB data
<?php
$link = mysqli_connect("localhost", "root", "usbw", "mith");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "
SELECT C.nome_clube , J.nome_jogador
FROM clube as C
RIGHT OUTER JOIN conta_user as UC ON C.id_clube = UC.id_conta
RIGHT OUTER JOIN jogador as J ON C.id_clube = J.id_jogador";
if ($result = mysqli_query($link, $query)) {
/* fetch associative array */
while ($row = mysqli_fetch_assoc($result)) {
printf ("%s (%s)\n", $row["nome_clube"], $row["nome_jogador"]);
}
/* free result set */
mysqli_free_result($result);
}
/* close connection */
mysqli_close($link);
?>