0){ $Updatesql = "UPDATE ".$_GET['type']." SET times_clicked = (times_clicked + 1) WHERE id='".$_GET['id']."'"; $UpdateQry = db_query($Updatesql); $row = mysql_fetch_assoc($qry); if($row['amazon_link'] || $row[$_GET['field']]){ $link = $_GET['field'] ? $row[$_GET['field']] : $row['amazon_link']; header("Location: ".$link); exit; }else{ header("Location: ".MAIN."/index.html?error=We do not have a valid link for this. Please try again later."); exit; } } }else{ header("Location: ".MAIN."/index.html?error=We do not have a valid link for this. Please try again later."); exit; }