i want to get some values from other tables so that i can create and insert , the code has some explenations,
the code shoud be run if the value that is give thrue a from is correct
I can't seem to get it working... please help me !!!!!!!!

PHP Code:
if($kamptype=="jongste")
    {        
        
//get the id where the 'kamp'= current year and the type is 'jongste'
        
$year date('Y');
        
$result mysql_query("SELECT Kampid FROM kamp WHERE Kampjaar = '$year' AND Kamptype = 'jongste'") or die(mysql_error());
        while(
$row mysql_fetch_array($result))
            {
                  
$kampid$row['Kampid']; // result will be used in a nother query
            
}
            
//get the last entered id from table kind
            
$laastekind="SELECT Max(kind.Kindid) FROM kind";
            
$result1 mysql_query($laastekind);        
            if (!
$result1
                {
                    echo 
"Fout in de input 1";
                }
                
            
$laatsteevaluatie="SELECT Max(kindevaluatie.KindEvaluatieid) FROM kindevaluatie";
            
$result2 mysql_query($laatsteevaluatie);        
            if (!
$result2
                {
                    echo 
"Fout in de input 1";
                }
            
            while(
$row1=mysql_fetch_assoc($result1) || $row2=mysql_fetch_assoc($result2))
                {
                    
$kampid$row['Kampid']; //the id of the kamp is set
                    
$laastekind=$row1['Max(kind.Kindid)']; // the max id of the table kind is set
                    
$kindevaluatie=$row1['Max(kindevaluatie.KindEvaluatieid)']; // the max id of table evalutie is set
                    
                    // now that all the variables are in place, this inser should take place
                    
$sql2="INSERT INTO kind_gaatmee_kamp (Kind_Kindid,Kamp_Kampid,KindEvaluatie_KindEvaluatieid) VALUES ('$laastekind','$kampid','$kindevaluatie')";
                    
$result3 mysql_query($sql2);        
                    if (!
$result3
                    {
                        echo 
"Fout in de input 1";
                    }
                }
    }