$sql = " SELECT t1.id, t1.datum, t1.achternaam, t3.naam AS activiteit FROM ".PREFIX."inschrijvingen AS t1, ".PREFIX."kampen AS t2 INNER JOIN ".PREFIX."activiteiten AS t3 ON t3.id = t1.kampid AND t3.id = t2.kamp_id WHERE t1.verwijderd = '0' AND t1.oud = '0' AND t1.kampid = '".$kamp."' ORDER BY t1.datum DESC"; that worked on php4 and mysql 3.25 but fails on php 5 and mysql 5 I get the folloing error: Unknown column 't1.kampid' in 'on clause' but t1.kampid is an existing column does any one know what this could be or how I could get the same results with another SELECT? Dimmy