$result=$db_init->query($sql = "select * from tractorpullingwekerom_nl_paginas where itemby = '$paginaid' order by positie desc");
while ($row=mysqli_fetch_array($result)){
$itemfoto="images/noimgitem.jpg?curtime=".time()."'";
$id=$row["id"];
$titel=$row["titel"];
$filepage=$row["pagina"];
$fotopagina = str_replace("_"," ", $filepage);
$selection = "tractorpullingwekerom_nl_afbeeldingen";
$result2=$db_init->query($sql = "select * from $selection where pagina='$id' and itemfoto='x' order by positie");
while ($row=mysqli_fetch_array($result2)){
$afbeeldingtitel=$row["titel"];
$itemfoto="images/".$fotopagina."-".$afbeeldingtitel."-item.jpg";
}
print " | ".$titel." |
";
print " | |
";
}
?>