PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi,
I have created this code to scan a directory and create a Light box gallery for each of them but for some reason when I run it i am getting 3 of the first file (the one that name should be) in each gallery and can't work out why?
I can't work out what you're trying to do in your code, but a couple of things:
1. glob() might be better than scandir() as it will give full paths and won't return . current and .. parent
2. Before you scandir() or glob a child file you need to check if it is_dir() first
3. I can't tell what output you want or what $first is used for
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.