I made this function. It's actually one of the first functions I've ever made. However, I can't get it to execute. $con is defined, i just didn't paste it. In fact, all of the variables are defined.
function cleanse() {
$cleansesql = "Select * FROM rated_teams WHERE server='$server' AND name='$myteam' AND opposition='$opposer'";
$result = mysqli_query($con, $cleansesql)
or die('A error occured: '.mysqli_error());
while (($row = mysqli_fetch_array($result))) {
if ($row['server'] == $server && $row['name'] == $myteam && $row['opposition'] == $opposer && $row['myscore'] == $myscore && $row['oscore'] == $oscore && $row['location'] == $location) {
echo "There is a Match.";
} else {
echo "There are no matches";
}
}
}
And this is how I'm calling it.
if ($solo == "solo" || $solo == "Solo" || $solo == "SOLO") {
echo $solo." <br />";
if (!empty($myscore)) {
echo $myscore." <br />";
if (!empty($oscore)) {
echo $oscore." <br />";
if (!empty($location)) {
echo $location." <br />";
cleanse();
}
}
}
}
Maybe I'm not calling it correctly. I just need someone who knows more than me to help... that'll be most of you hahaha.
$connas a function argument