Hello all,
I've been looking around for a while at scandir and other php functions for a way to insert all files in a given directory into a table and can't seem to get it. The files would have a sequential order like 1.jpg, 2.jpg, 3.jpg, etc.
Can someone give a link on a tutorial or, better yet, the script on how to do it?
Thanks!
phpuppy
PHP 5.2.5 - MySQL 5.0.45
script to insert all files from directory into db
Moderator: General Moderators
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: script to insert all files from directory into db
If you read the example on http://uk3.php.net/opendir it will give you a starting point for iterating over a directory of files.
Also the examples on http://uk2.php.net/mysql_query will probably help.
Also the examples on http://uk2.php.net/mysql_query will probably help.
Re: script to insert all files from directory into db
Gee, thanks, a link back to the manual... how helpful.