Het werkte wel op de vorige website, maar niet meer op de nieuwe. Dus ik denk dat ik een bepaalde functie in php moet instellen.
Dit is het script:
$albumqry ="
SELECT
webfoto_link,
webfoto_naam,
webfoto_tekst
FROM
webfoto
WHERE
webfoto_taal ='NL'
ORDER BY
volgnr";
if(!$statement = $connection->prepare($albumqry)){
echo 'Fout in query: '.$mysqli->error;
}
$statement->execute();
$result = $statement->get_result();
while($fotoalbum = $result->fetch_assoc())
{$folder = $fotoalbum['webfoto_link'];
if ($handle = opendir($pathfoto)){
if(is_dir($pathfoto.$folder)){
if ($handle2 = opendir($pathfoto.$folder."/tmb")){
while (false !== ($file = readdir($handle2))){
if($file != "." && $file != ".." && $file != "Thumbs.db" && $file != "tmb"){
$files[] = $file;
}
}
}
}
sort($files);
if(is_array($files)){
$map_foto = $urlfoto.$folder."/tmb/".$files[0];
}Dit zijn de foutmeldingen:
Fatal error: Uncaught Error: [] operator not supported for strings in /home/sds/domains/stage-drapes.nl/public_html/new/includes/fotoalbumscript.php:32 Stack trace: #0 /home/sds/domains/stage-drapes.nl/public_html/new/pages/fotoalbums.php(11): include_once() #1 /home/sds/domains/stage-drapes.nl/public_html/new/includes/sql.php(71): include_once('/home/sds/domai...') #2 /home/sds/domains/stage-drapes.nl/public_html/new/includes/functies.php(3): include_once('/home/sds/domai...') #3 /home/sds/domains/stage-drapes.nl/public_html/new/includes/index.php(4): include_once('/home/sds/domai...') #4 /home/sds/domains/stage-drapes.nl/public_html/index.php(13): include_once('/home/sds/domai...') #5 {main} thrown in /home/sds/domains/stage-drapes.nl/public_html/new/includes/fotoalbumscript.php on line 32
En regel 32 is
$files[] = $file;Is mijn script verouderd of moet ik iets aanpassen in mijn phpversie?