query($sql)) { trigger_error('Fout in query: '.$mysqli->error); } else { while($row = $result->fetch_assoc()) { if (file_exists("poster/".$row['id'].".jpg")) { $file = "poster/".$row['id'].".jpg"; } echo "\"".$row['titel']."\""; } } ?>