PHP expert |
|
heb de code al beetje verwerkt, maar de verwerking gebeurt normaal hetzelfde als de code die ik eerst heb geschreven. Werkt deze nu correct???
<?php
//de referrer zoeken
$Query_01 = mysql_fetch_assoc(mysql_query("SELECT * FROM members WHERE id='".$_COOKIE['ref_id']."'"));
$Query_02 = mysql_fetch_assoc(mysql_query("SELECT * FROM members WHERE id='".$Query_01['orgref']."'"));
$Query_03 = mysql_fetch_assoc(mysql_query("SELECT * FROM members WHERE id='".$Query_02['orgref']."'"));
$Query_04 = mysql_fetch_assoc(mysql_query("SELECT * FROM members WHERE id='".$Query_03['orgref']."'"));
$Query_05 = mysql_fetch_assoc(mysql_query("SELECT * FROM members WHERE id='".$Query_04['orgref']."'"));
//array qualifieds
$q = array("1" => $Query_01['qualified'], "2" => $Query_02['qualified'], "3" => $Query_03['qualified'], "4" => $Query_04['qualified'], "5" => $Query_05['qualified']);
//array id's
$id = array("1" => $Query_01['id'], "2" => $Query_02['id'], "3" => $Query_03['id'], "4" => $Query_04['id'], "5" => $Query_05['id']);
//iedere key controleren
if($q['1'] >= 2)
{
$ref = $id['1'];
}else{
if($q['2'] >= 2)
{
$ref = $id['2'];
}else{
if($q['3'] >= 2)
{
$ref = $id['3'];
}else{
if($q['4'] >= 2)
{
$ref = $id['4'];
}else{
$ref = $id['5'];
}
}
}
}
?>
<?php //de referrer zoeken //array qualifieds $q = array("1" => $Query_01['qualified'], "2" => $Query_02['qualified'], "3" => $Query_03['qualified'], "4" => $Query_04['qualified'], "5" => $Query_05['qualified']); //array id's $id = array("1" => $Query_01['id'], "2" => $Query_02['id'], "3" => $Query_03['id'], "4" => $Query_04['id'], "5" => $Query_05['id']); //iedere key controleren if($q['1'] >= 2) { $ref = $id['1']; }else{ if($q['2'] >= 2) { $ref = $id['2']; }else{ if($q['3'] >= 2) { $ref = $id['3']; }else{ if($q['4'] >= 2) { $ref = $id['4']; }else{ $ref = $id['5']; } } } } ?>
|