0) $sql = "SELECT * FROM grimoire WHERE Issue='$issue' LIMIT 1";
else $sql = "SELECT * FROM grimoire ORDER BY Issue DESC LIMIT 1";
$result = mysqli_query($conn, $sql);
if($row = mysqli_fetch_assoc($result)){
$grid = $row["GRID"];
if($row["LastIP"] != $ip){
$totalme = $row["Downloads"] + 1;
$result = mysqli_query($conn, "UPDATE grimoire SET Downloads=$totalme, LastIP='$ip' WHERE GRID='$grid' LIMIT 1");
}
$redirect = $row["Url"];
}
print "";
?>
Redirecting to desired web page.