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!
Moderator: General Moderators
andylyon87
Forum Contributor
Posts: 168 Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee
Post
by andylyon87 » Fri Apr 01, 2005 12:40 pm
Hey guys
just wondering if anyone knew a way of reading the number of files in a folder and putting them into a table of four cells wide.
So say I had 16 images in a file the would be sorted into the most recently added at the top and the oldest at the bottom in a table of 4 cells wide.
Is this possible in php alone without mySQL, cos I have no idea when it comes to that.
Thanks
Andy
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 01, 2005 1:22 pm
There is a thread about this specifically (in n-width tables) linked to from the "Useful Posts" thread (see link in my signature.)
andylyon87
Forum Contributor
Posts: 168 Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee
Post
by andylyon87 » Sat Apr 02, 2005 7:53 am
well that would be great but my host doesnt have a mySQL databaseon my package.
As said above is there anyway of doing this without mySQL
sory to be a pain
Andy
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Apr 02, 2005 8:42 am
you can take the logic parts away from mysql without problem. You simply need to generate a list of the files in the folder to parse. This can be done with glob() or opendir().