Hello!
I have a question. I have a table of matches in this table 5 cells id, team 1, team 2, event, bon. I wrote a code that displays all the information from the cells with a limit of 21
function getPost() { global $link; $sql = "SELECT * FROM `matches` ORDER BY id DESC LIMIT 0, 21 "; $result = mysqli_query($link, $sql); $posts = mysqli_fetch_all ($result, 1) ; return $posts; } How to do that in the transition to one match it was the data of this match that was displayed, here is my code:
function getMatch() { global $link; $sql = "SELECT 'id' FROM `matches` WHERE 'id'='Вот тут я даже не знаю что придумать'"; $result = mysqli_query($link, $sql); $matches = mysqli_fetch_all ($result, 1) ; return $matches; } With links everything is fine, for each match it has its own. For example: http://csesports.ru/match.php?m=38 .
But I don’t know how to put a link to the same match in the 2 function, because if I insert $match['id'] into the getMatch() function into the WHERE id = '' line, it starts to swear. How can I fix this?)
